Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Custom group names #44

Closed
stretch4x4 opened this issue Jan 29, 2016 · 4 comments
Closed

Feature: Custom group names #44

stretch4x4 opened this issue Jan 29, 2016 · 4 comments

Comments

@stretch4x4
Copy link
Contributor

It would really help us if we could easily rename the Custom Views section as the pages we are putting in there don't really fit with that. Maybe a setting that is passed into the template?

It would also be really good if we could have multiple groups or even better add to existing application/model groups.

@stretch4x4
Copy link
Contributor Author

When I have a little bit more time I might try to take a look at this to see how feasible some of these are.

@jsocol
Copy link
Owner

jsocol commented Feb 1, 2016

There are two issues here, renaming the section and groups.

I really don't care about renaming the section. But if someone wants to add it, I'd guess let's make it a property of the AdminPlusMixin (e.g. custom_list_title) and stick that into extra_context. And there'll need to be docs. It's just not a very high-value change, though.

Groups, I'm actively against supporting here. But there's something I think we could do to help make groups work, that's more of a general solution: adding the view object itself to custom_list, so each entry would look like (path, name, view).

This would let people pass data into the template by attaching it to the view, like:

def my_admin_view(request):
    return render(request, 'my_admin_template.html')
my_admin_view.group = 'group 1'
admin.site.register_view('my-admin-view', view=my_admin_view)

Then they can override the template to group however/wherever they want.

@stretch4x4
Copy link
Contributor Author

Both of those suggestions seem like a good idea to me.
If I can find a couple of hours I will have a play, although not sure when I will get a chance to do that.

@jsocol
Copy link
Owner

jsocol commented May 28, 2016

Closing in favor of #50

@jsocol jsocol closed this as completed May 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants