Rework VM list filter
More info: #458 (closed)
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
circle/dashboard/views/util.py
164 shared = stype == 'shared' or stype == 'all' 165 level = 'owner' if stype == 'owned' else 'user' 166 user = self.request.user 165 167 queryset = model.get_objects_with_level( 166 level, self.request.user, 167 group_also=shared, disregard_superuser=not superuser, 168 ) 168 level, user, group_also=shared, disregard_superuser=not superuser) 169 if stype == 'owned': 170 queryset = queryset.filter(owner=user) 171 elif stype == 'shared': 172 queryset = queryset.filter(owner=user) 173 174 pk_list = [] 175 for record in queryset: 176 sum = record.object_level_set.annotate( -
Owner
sum
is a built-in function, while this works it's not the nicest thing
-
-
Added 8 commits:
-
749d0686...a8272957 - 6 commits from branch
master
- 868c2ca6 - Merge branch 'master' into issue_458
- c894c76d - dashboard: small fix in FilterMixin
Toggle commit list -
749d0686...a8272957 - 6 commits from branch
-
Added 18 commits:
-
c894c76d...56975960 - 17 commits from branch
master
- ca15148f - Merge branch 'master' into issue_458
Toggle commit list -
c894c76d...56975960 - 17 commits from branch
-
Status changed to merged
Toggle commit list