Worked with admin interface, cleaning up and adding functionality. There are still some strange behaviour that makes e.g. the presence of inlines to auto-create empty database objects for some strange reason. Inlines are turned off at the moment (so there is no convenient way to add attributes from the admin interface at this time). Creating players now work, but one needs to create all three components (User, Player, Character) in one go and tie them together. The User-admin form was changed to also support multi-word usernames (django default didn't allow spaces).

This commit is contained in:
Griatch 2011-10-02 22:37:07 +02:00
parent 7f2e6dd4fa
commit bc0195bbaa
14 changed files with 285 additions and 117 deletions

View file

@ -12,7 +12,7 @@ class ScriptAttributeInline(admin.TabularInline):
max_num = 1
class ScriptDBAdmin(admin.ModelAdmin):
inlines = [ScriptAttributeInline]
list_display = ('id', 'db_key', 'db_typeclass_path', 'db_obj', 'db_interval', 'db_repeats', 'db_persistent')
list_display_links = ('id', 'db_key')
ordering = ['db_obj', 'db_typeclass_path']
@ -25,5 +25,7 @@ class ScriptDBAdmin(admin.ModelAdmin):
(None, {
'fields':(('db_key', 'db_typeclass_path'), 'db_interval', 'db_repeats', 'db_start_delay', 'db_persistent', 'db_obj')}),
)
#inlines = [ScriptAttributeInline]
admin.site.register(ScriptDB, ScriptDBAdmin)