Skip to content
Snippets Groups Projects
Commit 9773c6ca authored by joe's avatar joe
Browse files

Fixed the de-serialization of relations coming from Leveldb interface

parent f066d4d9
No related branches found
No related tags found
No related merge requests found
......@@ -42,6 +42,10 @@ class InMemoryRelationProxy(object):
def __repr__(self):
return '<InMemoryRelationProxy: [%s]>' % ', '.join(self._objs)
def to_net(self):
return list(self._objs)
class InMemoryObject(object):
......@@ -110,5 +114,3 @@ class InMemoryDbInterface(base.DbInterface):
entity = self.schema.get_entity(entity_name)
return self._run_query(entity, query,
self._entities[entity_name].itervalues())
......@@ -83,6 +83,8 @@ class Relation(Field):
if (isinstance(value, list)
and (not len(value) or not isinstance(value[0], basestring))):
return [x.name for x in value]
elif hasattr(value, 'to_net'):
return value.to_net()
else:
return value
......@@ -245,5 +247,3 @@ class Schema(object):
if valid:
sequence.append(entity.name)
return sequence
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment