Slightly cleaner docstring of BaseQuerySet.no_sub_classes [ci skip]

This commit is contained in:
Stefan Wojcik 2019-06-20 12:18:58 +02:00
parent ae0384df29
commit 799775b3a7

View File

@ -73,6 +73,7 @@ class BaseQuerySet(object):
self._initial_query = {
'_cls': {'$in': self._document._subclasses}}
self._loaded_fields = QueryFieldList(always_include=['_cls'])
self._cursor_obj = None
self._limit = None
self._skip = None
@ -707,8 +708,9 @@ class BaseQuerySet(object):
return queryset
def no_sub_classes(self):
"""
Only return instances of this document and not any inherited documents
"""Filter for only the instances of this specific document.
Do NOT return any inherited documents.
"""
if self._document._meta.get('allow_inheritance') is True:
self._initial_query = {'_cls': self._document._class_name}