Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #420 from Sancus/master
Browse files Browse the repository at this point in the history
[Bug 846678] change no_members to member_count for improved clarity
  • Loading branch information
Sancus committed Mar 4, 2013
2 parents d40fe59 + 9b8b09b commit 5532f53
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/groups/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GroupBaseAdmin(admin.ModelAdmin):
"""GroupBase Admin."""
save_on_top = True
search_fields = ['name']
list_display = ['name', 'no_members']
list_display = ['name', 'member_count']
list_display_links = ['name']
list_filter = [EmptyGroupFilter]

Expand All @@ -77,12 +77,12 @@ def get_form(self, request, obj=None, **kwargs):

def queryset(self, request):
return (super(GroupBaseAdmin, self)
.queryset(request).annotate(no_members=Count('userprofile')))
.queryset(request).annotate(member_count=Count('userprofile')))

def no_members(self, obj):
def member_count(self, obj):
"""Return number of members in group."""
return obj.no_members
no_members.admin_order_field = 'no_members'
return obj.member_count
member_count.admin_order_field = 'member_count'


class GroupAliasInline(admin.StackedInline):
Expand All @@ -107,7 +107,7 @@ class GroupAdmin(GroupBaseAdmin):
add_form = GroupAddAdminForm
inlines = [GroupAliasInline]
list_display = ['name', 'steward', 'wiki', 'website', 'irc_channel',
'no_members']
'member_count']
raw_id_fields = ['steward']
list_filter = [CurratedGroupFilter, EmptyGroupFilter]

Expand Down

0 comments on commit 5532f53

Please sign in to comment.