added .disable_inheritance method for the simple fetch exclusives classes
This commit is contained in:
parent
9dfee83e68
commit
96a964a183
2 changed files with 29 additions and 0 deletions
|
|
@ -520,6 +520,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`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue