Allow documents to override the 'objects' QuerySetManager
This commit is contained in:
parent
196606438c
commit
b96e27a7e4
1 changed files with 4 additions and 1 deletions
|
|
@ -252,7 +252,10 @@ class TopLevelDocumentMetaclass(DocumentMetaclass):
|
|||
# Set up collection manager, needs the class to have fields so use
|
||||
# DocumentMetaclass before instantiating CollectionManager object
|
||||
new_class = super_new(cls, name, bases, attrs)
|
||||
new_class.objects = QuerySetManager()
|
||||
|
||||
# Provide a default queryset unless one has been manually provided
|
||||
if not 'objects' in dir(new_class):
|
||||
new_class.objects = QuerySetManager()
|
||||
|
||||
user_indexes = [QuerySet._build_index_spec(new_class, spec)
|
||||
for spec in meta['indexes']] + base_indexes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue