Fixed indexing - turn off _cls (#414)
This commit is contained in:
@@ -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)):
|
||||
|
||||
@@ -536,6 +536,8 @@ class Document(BaseDocument):
|
||||
def ensure_indexes(cls):
|
||||
"""Checks the document meta data and ensures all the indexes exist.
|
||||
|
||||
Global defaults can be set in the meta - see :doc:`guide/defining-documents`
|
||||
|
||||
.. note:: You can disable automatic index creation by setting
|
||||
`auto_create_index` to False in the documents meta data
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user