Explorar o código

Tweaked ordering of tags list

Jeremy Stretch %!s(int64=7) %!d(string=hai) anos
pai
achega
601fb418b5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/utilities/views.py

+ 1 - 1
netbox/utilities/views.py

@@ -121,7 +121,7 @@ class ObjectListView(View):
 
         # Construct queryset for tags list
         if hasattr(model, 'tags'):
-            tags = model.tags.annotate(count=Count('taggit_taggeditem_items'))
+            tags = model.tags.annotate(count=Count('taggit_taggeditem_items')).order_by('-count', 'name')
         else:
             tags = None