Merge remote-tracking branch 'origin/pr/312' into 312

This commit is contained in:
Ross Lawley
2013-05-10 14:44:44 +00:00
2 changed files with 29 additions and 0 deletions

View File

@@ -569,6 +569,15 @@ class QuerySet(object):
queryset._none = True
return queryset
def disable_inheritance(self):
"""
Disable inheritance query, fetch only objects for the query class
"""
if self._document._meta.get('allow_inheritance') is True:
self._initial_query = {"_cls": self._document._class_name}
return self
def clone(self):
"""Creates a copy of the current
:class:`~mongoengine.queryset.QuerySet`