Code

Ticket #6946: 6946_python23.diff

File 6946_python23.diff, 692 bytes (added by axiak, 6 years ago)

Python2.3 compatible

Line 
1Index: contrib/databrowse/sites.py
2===================================================================
3--- contrib/databrowse/sites.py (revision 7397)
4+++ contrib/databrowse/sites.py (working copy)
5@@ -123,6 +123,10 @@
6 
7     def index(self, request):
8         m_list = [EasyModel(self, m) for m in self.registry.keys()]
9+        # Now we sort the model list alphabetically.
10+        m_list = [(x.__name__.lower(), x) for x in m_list]
11+        m_list.sort()
12+        m_list = [x[1] for x in m_list]
13         return render_to_response('databrowse/homepage.html', {'model_list': m_list, 'root_url': self.root_url})
14 
15     def model_page(self, request, app_label, model_name, rest_of_url=None):