Explicitly assign typeclass for newly created objectdb
This commit is contained in:
parent
19e8bed5ab
commit
5e7211a053
1 changed files with 7 additions and 0 deletions
|
|
@ -147,6 +147,13 @@ class ObjectDBAdmin(admin.ModelAdmin):
|
||||||
obj.save()
|
obj.save()
|
||||||
if not change:
|
if not change:
|
||||||
# adding a new object
|
# adding a new object
|
||||||
|
# no idea why this has to be called manually, __init__ does not seem to be called
|
||||||
|
from evennia.utils.utils import class_from_module
|
||||||
|
try:
|
||||||
|
typeclass = class_from_module(obj.db_typeclass_path)
|
||||||
|
except ImportError:
|
||||||
|
typeclass = class_from_module("evennia.objects.objects.DefaultObject")
|
||||||
|
obj.__class__ = typeclass
|
||||||
obj.basetype_setup()
|
obj.basetype_setup()
|
||||||
obj.basetype_posthook_setup()
|
obj.basetype_posthook_setup()
|
||||||
obj.at_object_creation()
|
obj.at_object_creation()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue