Finally got around to creating admin.py files for all of the apps. This will prevent some really weird import errors and fixes an issue with the Attribute model's admin display. May also cut resource usage slightly for MUD server instances. Needs more testing!

This commit is contained in:
Greg Taylor 2009-04-17 03:08:18 +00:00
parent 1da2179ee6
commit 573d1b6e88
9 changed files with 49 additions and 62 deletions

View file

@ -1,5 +1,4 @@
from django.db import models
from django.contrib import admin
from src.config.managers.commandalias import CommandAliasManager
from src.config.managers.configvalue import ConfigValueManager
from src.config.managers.connectscreen import ConnectScreenManager
@ -17,13 +16,6 @@ class CommandAlias(models.Model):
class Meta:
verbose_name_plural = "Command aliases"
ordering = ['user_input']
class CommandAliasAdmin(admin.ModelAdmin):
list_display = ('user_input', 'equiv_command')
pass
# This is causing an error for some reason
#admin.site.register(CommandAlias, CommandAliasAdmin)
admin.site.register(CommandAlias)
class ConfigValue(models.Model):
"""
@ -36,10 +28,6 @@ class ConfigValue(models.Model):
def __unicode__(self):
return "%s" % self.conf_key
class ConfigValueAdmin(admin.ModelAdmin):
list_display = ('conf_key', 'conf_value')
admin.site.register(ConfigValue, ConfigValueAdmin)
class ConnectScreen(models.Model):
"""
@ -50,9 +38,4 @@ class ConnectScreen(models.Model):
text = models.TextField(help_text="The text for the connect screen. Color codes and substitutions are evaluated.")
is_active = models.BooleanField(default=1, help_text="Only active connect screens are placed in the rotation")
objects = ConnectScreenManager()
class ConnectScreenAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'is_active')
list_display_links = ('id', 'name')
admin.site.register(ConnectScreen, ConnectScreenAdmin)
objects = ConnectScreenManager()