Answer the question
In order to leave comments, you need to log in
How in django admin to sort fields in a dropdown list editor?
There is a model in which there is a field of type models.ForeignKey.
In the editor, this field is rendered as a drop-down list with incomprehensible sorting. How to sort it properly?
Answer the question
In order to leave comments, you need to log in
Look at 2 top answers, they describe 2 possible ways to solve your problem.
https://stackoverflow.com/questions/18742632/how-t...
Meta.ordering
on the model referenced by your foreign keyformfield_for_foreignkey
in your model's admin classDidn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question