mirror of
https://github.com/evennia/evennia.git
synced 2026-03-26 17:56:32 +01:00
Attribute cache is working, lots of other updates, but still not a cleanly updatable system. It seems the Attribute-migrations are not coming through properly. Fixed a misnamed table in the comm app.
This commit is contained in:
parent
033344ad2c
commit
2b332c3b9a
16 changed files with 229 additions and 179 deletions
|
|
@ -1,31 +1,32 @@
|
|||
#
|
||||
# This sets up how models are displayed
|
||||
# in the web admin interface.
|
||||
# This sets up how models are displayed
|
||||
# in the web admin interface.
|
||||
#
|
||||
|
||||
from src.scripts.models import ScriptAttribute, ScriptDB
|
||||
from src.typeclasses.models import Attribute
|
||||
from src.scripts.models import ScriptDB
|
||||
from django.contrib import admin
|
||||
|
||||
class ScriptAttributeInline(admin.TabularInline):
|
||||
model = ScriptAttribute
|
||||
fields = ('db_key', 'db_value')
|
||||
class AttributeInline(admin.TabularInline):
|
||||
model = Attribute
|
||||
fields = ('db_key', 'db_value')
|
||||
max_num = 1
|
||||
|
||||
class ScriptDBAdmin(admin.ModelAdmin):
|
||||
|
||||
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']
|
||||
search_fields = ['^db_key', 'db_typeclass_path']
|
||||
save_as = True
|
||||
ordering = ['db_obj', 'db_typeclass_path']
|
||||
search_fields = ['^db_key', 'db_typeclass_path']
|
||||
save_as = True
|
||||
save_on_top = True
|
||||
list_select_related = True
|
||||
list_select_related = True
|
||||
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields':(('db_key', 'db_typeclass_path'), 'db_interval', 'db_repeats', 'db_start_delay', 'db_persistent', 'db_obj')}),
|
||||
)
|
||||
#inlines = [ScriptAttributeInline]
|
||||
#inlines = [AttributeInline]
|
||||
|
||||
|
||||
admin.site.register(ScriptDB, ScriptDBAdmin)
|
||||
|
|
|
|||
|
|
@ -34,24 +34,6 @@ from src.scripts.manager import ScriptManager
|
|||
|
||||
__all__ = ("ScriptDB",)
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
# ScriptAttribute
|
||||
#
|
||||
#------------------------------------------------------------
|
||||
|
||||
#class ScriptAttribute(Attribute):
|
||||
# "Attributes for ScriptDB objects."
|
||||
# db_obj = models.ForeignKey("ScriptDB", verbose_name='script')
|
||||
#
|
||||
# class Meta:
|
||||
# "Define Django meta options"
|
||||
# verbose_name = "Script Attribute"
|
||||
# verbose_name_plural = "Script Attributes"
|
||||
#
|
||||
## attach cache handlers for attribute lookup
|
||||
#post_init.connect(attr_post_init, sender=ScriptAttribute, dispatch_uid="scriptattrcache")
|
||||
#pre_delete.connect(attr_pre_delete, sender=ScriptAttribute, dispatch_uid="scriptattrcache")
|
||||
|
||||
#------------------------------------------------------------
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue