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

Allow ordering of models in the admin index #12699

Closed
wants to merge 2 commits into from

Conversation

olivierdalang
Copy link
Contributor

This PR allows to display the models in a specific order per app on the admin index and the app index, using a new order_in_index option on ModelAdmin.

When left to default (None), the models are sorted alphabetically (backwards compatible).

This helps deal with a common case where there is some logical order between models that does not match alphabetical order (e.g. Continents, Countries, Counties, Cities is much more usable than Cities, Continents, Counties, Countries). There is no easy way to achieve this, except by prepending verbose_name with spaces, which is not very elegant.

@felixxm
Copy link
Member

felixxm commented Apr 11, 2020

Accepted ticket is required for all new features.

@olivierdalang
Copy link
Contributor Author

Oops my bad, I'm not used to the process yet... I'll open a ticket. Can this stay open in the mean time ?

@hramezani
Copy link
Member

Can be related to this ticket

@olivierdalang
Copy link
Contributor Author

Can be related to this ticket

Thanks hadn't found it. I reopened the ticket, hope this is OK.

@carltongibson
Copy link
Member

Closing as per ticket-25671

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants