From cd0496fa114ba4a3e65bd51aab70b20991c46fb5 Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Thu, 27 Sep 2018 18:00:42 -0400 Subject: [PATCH] Add owner and team count to Org admin --- events/admin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/events/admin.py b/events/admin.py index d248389..b30aeda 100644 --- a/events/admin.py +++ b/events/admin.py @@ -107,7 +107,10 @@ class ProfileAdmin(admin.ModelAdmin): admin.site.register(UserProfile, ProfileAdmin) class OrgAdmin(admin.ModelAdmin): - list_display = ('name', 'slug', 'site') + list_display = ('name', 'slug', 'team_count', 'owner_profile', 'site') + def team_count(self, org): + return org.teams.all().count() + team_count.short_description = 'Teams' admin.site.register(Organization, OrgAdmin) class OrgRequestAdmin(admin.ModelAdmin):