Gauravwagh / django-grappelli

Automatically exported from code.google.com/p/django-grappelli
Other
0 stars 0 forks source link

dashboard.modules.ModelList results need a stable sorting #349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When using a ModelList in the dashboard the results are unsorted and change 
there order on every refresh of the page. 
As the AppList class is sorting theire models by 'title' I propose the 
ModelList should do that too, by default.
However a nicer way to define a sorting would be a nice to have.

So the change i propose would be adding:

---
self.children.sort(key=lambda x: x['title'])

---
to the init_with_context method of the ModelList

Original issue reported on code.google.com by defaultw...@gmail.com on 24 Feb 2011 at 8:23

GoogleCodeExporter commented 9 years ago
should be fixed. I´ve included the patch from django-admin-tools (see 
https://bitbucket.org/izi/django-admin-tools/issue/73/sort-models).
thanks for the hint (and patch).

Original comment by sehmaschine on 17 Mar 2011 at 4:27