From 756751ab7f5c8329630a766b7718790c2790a845 Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Wed, 12 Aug 2009 15:36:35 -0600 Subject: Add a couple fields to mirror admin at Aaron's request --- main/admin.py | 2 +- main/models.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/admin.py b/main/admin.py index 20532090..812332b8 100644 --- a/main/admin.py +++ b/main/admin.py @@ -53,7 +53,7 @@ class MirrorRsyncInlineAdmin(admin.TabularInline): extra = 2 class MirrorAdmin(admin.ModelAdmin): - list_display = ('name', 'country', 'active', 'public', 'isos', 'notes') + list_display = ('name', 'country', 'active', 'public', 'isos', 'notes', 'admin_email', 'supported_protocols') list_filter = ('country', 'active', 'public') ordering = ['country', 'name'] search_fields = ('name',) diff --git a/main/models.py b/main/models.py index ebb0368d..580e1eec 100644 --- a/main/models.py +++ b/main/models.py @@ -62,6 +62,10 @@ class Mirror(models.Model): def __unicode__(self): return self.name + def supported_protocols(self): + protocols = MirrorProtocol.objects.filter(urls__mirror=self).distinct() + return ", ".join([p.protocol for p in protocols]) + class MirrorProtocol(models.Model): protocol = models.CharField(max_length=10, unique=True) def __unicode__(self): -- cgit v1.2.3-54-g00ecf From 88d83dfaa66d6a01621dcff61b441babdf4833ce Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Wed, 12 Aug 2009 15:39:56 -0600 Subject: Add a couple columns to user admin at Aaron's request. --- main/admin.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main') diff --git a/main/admin.py b/main/admin.py index 812332b8..fc482f44 100644 --- a/main/admin.py +++ b/main/admin.py @@ -79,6 +79,8 @@ class UserProfileInline(admin.StackedInline): class UserProfileAdmin(UserAdmin): inlines = [UserProfileInline] + list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'is_active') + list_filter = ('is_staff', 'is_superuser', 'is_active') admin.site.register(User, UserProfileAdmin) -- cgit v1.2.3-54-g00ecf