Fixed sparse indexes with inheritance

fixes hmarr/mongoengine#497
This commit is contained in:
Ross Lawley 2012-05-14 12:06:25 +01:00
parent bab186e195
commit ec5ddbf391
2 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Changelog
Changes in 0.6.9
================
- Fixed sparse indexes on inherited docs
- Removed FileField auto deletion, needs more work maybe 0.7
Changes in 0.6.8

View File

@ -512,6 +512,10 @@ class QuerySet(object):
key = '.'.join(parts)
index_list.append((key, direction))
# If sparse - dont include types
if spec.get('sparse', False):
use_types = False
# Check if a list field is being used, don't use _types if it is
if use_types and not all(f._index_with_types for f in fields):
use_types = False