whoops, don't dereference all references as the first type encountered

This commit is contained in:
Greg Banks
2012-04-12 11:42:10 -07:00
parent a1d43fecd9
commit 49a66ba81a
2 changed files with 16 additions and 3 deletions

View File

@@ -112,10 +112,11 @@ class DeReference(object):
for ref in references:
if '_cls' in ref:
doc = get_document(ref["_cls"])._from_son(ref)
elif doc_type is None:
doc = get_document(
''.join(x.capitalize()
for x in col.split('_')))._from_son(ref)
else:
if doc_type is None:
doc_type = get_document(
''.join(x.capitalize() for x in col.split('_')))
doc = doc_type._from_son(ref)
object_map[doc.id] = doc
return object_map