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

22
src/objects/admin.py Normal file
View file

@ -0,0 +1,22 @@
from src.objects.models import Attribute, Object, CommChannel, CommChannelMessage
from django.contrib import admin
class AttributeAdmin(admin.ModelAdmin):
list_display = ('attr_object', 'attr_name', 'attr_value',)
search_fields = ['attr_name']
admin.site.register(Attribute, AttributeAdmin)
class ObjectAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'type', 'date_created')
list_filter = ('type',)
search_fields = ['name']
save_on_top = True
admin.site.register(Object, ObjectAdmin)
class CommChannelAdmin(admin.ModelAdmin):
list_display = ('name', 'owner')
admin.site.register(CommChannel, CommChannelAdmin)
class CommChannelMessageAdmin(admin.ModelAdmin):
list_display = ('channel', 'message')
admin.site.register(CommChannelMessage, CommChannelMessageAdmin)