File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
landolfio/inventory_frontend Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def get_context_data(self, **kwargs):
7676 categories = (
7777 Category .objects .annotate (asset_count = Count ("asset" ))
7878 .filter (asset_count__gt = 0 )
79- .order_by ("-asset_count " )
79+ .order_by ("order" , "name " )
8080 .prefetch_related ("size_set" )
8181 )
8282
@@ -129,9 +129,11 @@ def get_context_data(self, **kwargs):
129129 context ["locations" ] = root_locations
130130
131131 # Get collections with counts
132- context ["collections" ] = Collection .objects .annotate (
133- asset_count = Count ("asset" )
134- ).order_by ("-asset_count" )[:5 ]
132+ context ["collections" ] = (
133+ Collection .objects .annotate (asset_count = Count ("asset" ))
134+ .filter (asset_count__gt = 0 )
135+ .order_by ("order" , "name" )
136+ )
135137
136138 return context
137139
You can’t perform that action at this time.
0 commit comments