开发者

How to change ordering in foreign key fields in django admin change_form

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

When adding or editing a task, projects are displayed as dropdown as it should, but dropdown is ordered by ID (or no ordering at all). Because i start to have plenty of projects, is there a way to get projects in a dropdown in 开发者_如何学编程alphabetical order?


The objects should be ordered according to the default ordering specified on their model!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜