Django: How to sort a ModelForm's Many2ManyField (Select Tag) according to the object's __unicode__() value?


Django: How to sort a ModelForm's Many2ManyField (Select Tag) according to the object's __unicode__() value?



As stated in the title.




Timestamp conversion is off by an hour

1:



Would extracting page metadata be a good use of multiple inheritance?
The sort would have to be done in Python since the database has no idea what you're doing in __unicode__().


Customizing Django auto admin terminology
So you'd have to retrieve all of the related model instances into a list, sort the list using the __unicode__() value of the instances, and then use that list wherever you want..
Traversing multi-dimensional dictionary in django
The following document has a number of methods for sorting in python: http://wiki.python.org/moin/HowTo/Sorting/.
Configuring Django to use SQLAlchemy


Http verb decorator for Django?


94 out of 100 based on 84 user ratings 934 reviews