Fixed website. Fixing references to db_references, not sure how to add the m2m field access to the admin. Fixed wrapper for db_home.

This commit is contained in:
Griatch 2013-09-23 22:08:14 +02:00
parent 272a6ddc2d
commit fd9acd6bf9
11 changed files with 187 additions and 261 deletions

View file

@ -53,7 +53,7 @@ _GA = object.__getattribute__
def create_object(typeclass, key=None, location=None,
home=None, permissions=None, locks=None,
aliases=None, destination=None, report_to=None):
aliases=None, destination=None, report_to=None, testmode=False):
"""
Create a new in-game object. Any game object is a combination
of a database object that stores data persistently to
@ -69,6 +69,7 @@ def create_object(typeclass, key=None, location=None,
If report_to is not set, errors will be raised as en Exception
containing the error message. If set, this method will return
None upon errors.
testmode is only intended for Evennia unittest system
"""
global _Object, _ObjectDB
if not _Object:
@ -134,6 +135,9 @@ def create_object(typeclass, key=None, location=None,
# perform a move_to in order to display eventual messages.
if home:
new_object.home = home
elif testmode:
# this is required by unittest
pass
else:
new_object.home = settings.CHARACTER_DEFAULT_HOME