Fix PY3 hasattr connecting to the db at define time
This commit is contained in:
parent
0d0befe23e
commit
14b6c471cf
2 changed files with 3 additions and 1 deletions
|
|
@ -340,7 +340,7 @@ class TopLevelDocumentMetaclass(DocumentMetaclass):
|
|||
new_class._meta['collection'] = collection(new_class)
|
||||
|
||||
# Provide a default queryset unless exists or one has been set
|
||||
if not hasattr(new_class, 'objects'):
|
||||
if 'objects' not in dir(new_class):
|
||||
new_class.objects = QuerySetManager()
|
||||
|
||||
# Validate the fields and set primary key if needed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue