Fixed index spec inheritance (MongoEngine/mongoengine#111)

This commit is contained in:
Ross Lawley
2012-09-04 08:20:19 +01:00
parent 1cf3989664
commit 3534bf7d70
3 changed files with 27 additions and 0 deletions

View File

@@ -510,6 +510,10 @@ class QuerySet(object):
use_types = allow_inheritance and not spec.get('sparse', False)
for key in spec['fields']:
# If inherited spec continue
if isinstance(key, (list, tuple)):
continue
# Get ASCENDING direction from +, DESCENDING from -, and GEO2D from *
direction = pymongo.ASCENDING
if key.startswith("-"):