fix-#733: index_cls is ignored when deciding to set _cls as index prefix

This commit is contained in:
DavidBord
2014-08-17 11:19:18 +03:00
parent bb7e5f17b5
commit 46da918dbe
2 changed files with 13 additions and 0 deletions

View File

@@ -718,6 +718,9 @@ class BaseDocument(object):
ALLOW_INHERITANCE)
include_cls = (allow_inheritance and not spec.get('sparse', False) and
spec.get('cls', True))
# 733: don't include cls if index_cls is False unless there is an explicit cls with the index
include_cls = include_cls and (spec.get('cls', False) or cls._meta.get('index_cls', True))
if "cls" in spec:
spec.pop('cls')
for key in spec['fields']: