Fixed indexing - turn off _cls (#414)

This commit is contained in:
Ross Lawley
2013-07-30 11:43:52 +00:00
parent dc310b99f9
commit 0c43787996
5 changed files with 57 additions and 2 deletions

View File

@@ -629,8 +629,10 @@ class BaseDocument(object):
# Check to see if we need to include _cls
allow_inheritance = cls._meta.get('allow_inheritance',
ALLOW_INHERITANCE)
include_cls = allow_inheritance and not spec.get('sparse', False)
include_cls = (allow_inheritance and not spec.get('sparse', False) and
spec.get('cls', True))
if "cls" in spec:
spec.pop('cls')
for key in spec['fields']:
# If inherited spec continue
if isinstance(key, (list, tuple)):