I have a model (Node) which is ordered by date in the admin, so latest nodes are shown first. This is fine.
The same model (Node) is referenced by another model (Device). When editing a device there is a list of nodes (in an HTML select) which is also ordered by date.
I would like this select to be ordered by name and not by date.
Is it possible to have two different ordering methods, one for the list of objects and one for the select box?
Thanks.
The easiest thing would be to override the
formfield_for_foreignkeymethod in theModelAdminforDevice, something like(I’m assuming a fair amount here. Hopefully it’s clear!)
Similarly there’s
formfield_for_manytomany.