Sorted users of a fleet by user name
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 10 May 2011 15:28:41 +0000 (15:28 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 10 May 2011 15:28:41 +0000 (15:28 +0000)
bin/djais/views.py

index 7f29e43f5d10b996ee246e2d416a61b90e5add6e..dfb6158564f59b7607712205c6c1cf7d43675920 100644 (file)
@@ -823,7 +823,7 @@ def fleet_users(request, fleetname):
             else:
                 request.user.error(u'Unknown action %s' % action)
 
-    fleetusers = fleet.fleetuser_set.all()
+    fleetusers = fleet.fleetuser_set.order_by('user__name')
     otherusers = User.objects.exclude(id__in=[fu.user.id for fu in fleetusers]).order_by('name')
     return render_to_response('fleet_users.html', {'fleet':fleet, 'fleetusers': fleetusers, 'otherusers': otherusers}, RequestContext(request))