From: Matthijs Kooijman Date: Mon, 28 Jul 2008 16:14:08 +0000 (+0200) Subject: Migrate applications to the new admin interface. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=3fdc7c9e5858d53c0d1863c9f9391ce520bb9c76;p=matthijs%2Fprojects%2Fxerxes.git Migrate applications to the new admin interface. --- 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")