How to reorder foreign key fields in django admin change_form

I have two tables, tasks and projects. And each task has a project (and each project can have N tasks).

When you add or edit a task, projects are displayed as drop-down menus, but the drop-down menu is ordered by identifier (or not ordered at all). Since I have many projects, is there any way to get the projects in the drop-down list in alphabetical order?

+4
source share
1 answer

Objects must be ordered in accordance with the standard order indicated on their model!

+7
source

All Articles