Resolves issue 156.

This commit is contained in:
Griatch 2011-04-08 20:06:04 +00:00
parent 695317e699
commit 0cff54f136

View file

@ -178,6 +178,12 @@ def create_script(typeclass, key=None, obj=None, locks=None, autostart=True):
else:
new_script.key = "#%i" % new_db_object.id
if obj:
try:
new_script.obj = obj
except ValueError:
new_script.obj = obj.dbobj
# call the hook method. This is where all at_creation
# customization happens as the typeclass stores custom
# things on its database object.
@ -190,12 +196,6 @@ def create_script(typeclass, key=None, obj=None, locks=None, autostart=True):
if locks:
new_script.locks.add(locks)
if obj:
try:
new_script.obj = obj
except ValueError:
new_script.obj = obj.dbobj
# a new created script should usually be started.
if autostart:
new_script.start()