Skip to content

Incompatible types for link assignments? #477

Answered by Lingomat
Lingomat asked this question in Question
Discussion options

You must be logged in to vote

So, the way to fix this:

from bson import DBRef

documentlink = Link(DBRef('collection', <id>), <model_class>)

Now one can assign a linked field in a model instance directly to this link and get no type errors.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Lingomat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant