def read(cls, key, mode = FetchMode.All): """Retreives objects from the datastore """ assert isinstance(key, (basestring, Key)) namespace, kind, member = Schema.Get(cls) if isinstance(key, Key): assert kind == key.kind, "Mismatched Model, reading a %s with %s" % (kind, key.kind) return Lisa.read(key, mode) else: key = Key(namespace, kind, key) return Lisa.read(key, mode)
def deconvert(self, value): '''Pulls the referenced model from the datastore, and sets it''' key = eval(value) #Change the @value back to a key. if key: found = Lisa.read(key, FetchMode.All) return found else: return None