Fix the ._get_db() attribute after a Document.switch_db()
Without this patch, I've got: ``` myobj._get_db() <bound method TopLevelDocumentMetaclass._get_db of <class 'oneflow.core.models.nonrel.Article'>> ``` I need to `myobj._get_db()()` to get the database. I felt this like a bug. regards,
This commit is contained in:
parent
5bcc454678
commit
f30208f345
@ -400,7 +400,7 @@ class Document(BaseDocument):
|
||||
"""
|
||||
with switch_db(self.__class__, db_alias) as cls:
|
||||
collection = cls._get_collection()
|
||||
db = cls._get_db
|
||||
db = cls._get_db()
|
||||
self._get_collection = lambda: collection
|
||||
self._get_db = lambda: db
|
||||
self._collection = collection
|
||||
|
Loading…
x
Reference in New Issue
Block a user