From 7d0ec33b54d97622a0e845cf0382b33ae40476f5 Mon Sep 17 00:00:00 2001 From: vahan Date: Sun, 1 May 2016 22:59:39 -0400 Subject: [PATCH] * fixed the bug where dynamic doc has indx inside dict field --- mongoengine/base/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mongoengine/base/document.py b/mongoengine/base/document.py index 05b3ad95..63dbf0db 100644 --- a/mongoengine/base/document.py +++ b/mongoengine/base/document.py @@ -974,7 +974,7 @@ class BaseDocument(object): if hasattr(getattr(field, 'field', None), 'lookup_member'): new_field = field.field.lookup_member(field_name) elif cls._dynamic and (isinstance(field, DynamicField) or - getattr(getattr(field, 'document_type'), '_dynamic')): + getattr(getattr(field, 'document_type', None), '_dynamic', None)): new_field = DynamicField(db_field=field_name) else: # Look up subfield on the previous field or raise