use class from self.__class__ when serializing BackLinks with fetched data#1207
use class from self.__class__ when serializing BackLinks with fetched data#1207alexdlukens wants to merge 1 commit intoBeanieODM:mainfrom
Conversation
337d6f7 to
80da15b
Compare
maybe a getattr(self, "document_class", self.class) instead ? With attribute: Without attribute: this is what i got with a testing script (using timeit) |
This is the case when BackLink data has been fetched using fetch_links=True
80da15b to
2685fae
Compare
|
This PR is stale because it has been open 45 days with no activity. |
|
This PR is stale because it has been open 45 days with no activity. |
|
This PR is stale because it has been open 45 days with no activity. |
This is my proposed solution for #1189. Please find the minimal code example in the issue report.
This fixes serialization in the case when BackLink data has been fetched using
fetch_links=True. In this situation, the BackLink field contains aDocumentobject, which does not have thedocument_classattribute.Thanks,