From 1bb2b8d9a9226c77a0908db2d9abe7b787f01e56 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sat, 8 Apr 2017 09:39:43 +0200 Subject: [PATCH] a bit more work on the team admin --- src/teams/admin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/teams/admin.py b/src/teams/admin.py index 6c304725..cf306dc1 100644 --- a/src/teams/admin.py +++ b/src/teams/admin.py @@ -6,8 +6,20 @@ admin.site.register(TeamArea) @admin.register(Team) class TeamAdmin(admin.ModelAdmin): + def get_responsible(self, obj): + return ", ".join([resp.get_full_name() for resp in obj.responsible]) + get_responsible.short_description = 'Responsible' + + list_display = [ + 'name', + 'area', + 'get_responsible', + 'needs_members', + ] + list_filter = [ 'camp', + 'needs_members', ] @admin.register(TeamMember)