From 3fdc7c9e5858d53c0d1863c9f9391ce520bb9c76 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 28 Jul 2008 18:14:08 +0200 Subject: [PATCH] Migrate applications to the new admin interface. --- base/admin.py | 7 +++++++ events/models.py | 6 ------ influences/admin.py | 17 +++++++++++++++++ influences/models.py | 10 ---------- 4 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 base/admin.py create mode 100644 influences/admin.py diff --git a/base/admin.py b/base/admin.py new file mode 100644 index 0000000..4353ce3 --- /dev/null +++ b/base/admin.py @@ -0,0 +1,7 @@ +from django.contrib import admin +from xerxes.base.models import UserProfile + +class UserProfileAdmin(admin.ModelAdmin): + pass + +admin.site.register(UserProfile, UserProfileAdmin) diff --git a/events/models.py b/events/models.py index 55228d4..82868b2 100644 --- a/events/models.py +++ b/events/models.py @@ -13,12 +13,6 @@ class Event(models.Model): else: return self.name -# class Admin: -# fields = ( -# (None, {'fields' : ('name', 'title')} ), -# ('Registrations', {'fields' : ('slots',)} ), -# ) - class Registration(models.Model): person = models.ForeignKey(User, edit_inline=models.STACKED, num_in_admin=3) event = models.ForeignKey(Event, core=True) diff --git a/influences/admin.py b/influences/admin.py new file mode 100644 index 0000000..afdf6d7 --- /dev/null +++ b/influences/admin.py @@ -0,0 +1,17 @@ +from django.contrib import admin +from xerxes.influences.models import Character, Influence + +class CharacterAdmin(admin.ModelAdmin): + list_filter=('status', 'player') + search_fields=('name',) + list_display=('player', 'name', 'status') + +admin.site.register(Character, CharacterAdmin) + +class InfluenceAdmin(admin.ModelAdmin): + list_filter=('character', 'status', 'longterm') + search_fields=('character', 'summary', 'description', 'contact') + list_display=('character', 'contact', 'summary', 'longterm', 'status') + +admin.site.register(Influence, InfluenceAdmin) + diff --git a/influences/models.py b/influences/models.py index 8124b85..1079b0a 100644 --- a/influences/models.py +++ b/influences/models.py @@ -17,11 +17,6 @@ class Character(models.Model): def __str__(self): return self.name - class Admin: - list_filter=('status', 'player') - search_fields=('name') - list_display=('player', 'name', 'status') - class Meta: verbose_name = _("Character") verbose_name_plural = _("Characters") @@ -48,11 +43,6 @@ class Influence(models.Model): def __str__(self): return self.summary - class Admin: - list_filter=('character', 'status', 'longterm') - search_fields=('character', 'summary', 'description', 'contact') - list_display=('character', 'contact', 'summary', 'longterm', 'status') - class Meta: verbose_name = _("Influence") verbose_name_plural = _("Influences") -- 2.30.2