OBS: Migration needed(objects, scripts, players). This resolves issue 136 by allowing database objects to be nested in lists and dictionaries as

attributes on objects. Behind the scenes, only the DBREF is stored since storing dbobjects cannot be pickled. One used to be able to store single objects this way, but objects hidden in nested iterable structures were not found. Note that ONLY lists and dictionaries are supported to store on attributes - custom iterables will be stored and retrieved as a generic list instead - this is a tradeoff to be able to store database objects.

To migrate, give the following commands from game/:
 migrate.py migrate objects
 migrate.py migrate scripts
 migrate.py migrate players
This commit is contained in:
Griatch 2011-04-05 23:28:40 +00:00
parent 02775398c4
commit 6eff51de20
6 changed files with 435 additions and 106 deletions

View file

@ -90,7 +90,7 @@ class RedButton(Object):
# scripts that depend on the lid to be closed.
self.scripts.validate()
# now add new scripts that define the open-lid state
self.obj.scripts.add(scriptexamples.OpenLidState)
self.scripts.add(scriptexamples.OpenLidState)
# we also add a scripted event that will close the lid after a while.
# (this one cleans itself after being called once)
self.scripts.add(scriptexamples.CloseLidEvent)
@ -125,7 +125,7 @@ class RedButton(Object):
"""
self.db.lamp_works = False
self.obj.db.desc = "The big red button has stopped blinking for the time being."
self.db.desc = "The big red button has stopped blinking for the time being."
if feedback and self.location:
string = "The lamp flickers, the button going dark."