You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Unable to use string references with Link across different modules. When using string references for Link without importing the actual model classes (i.e., relying on forward references), a ForwardRef error is raised. This issue arises when models from different modules reference each other.
To Reproduce
Provide the following code snippet to reproduce the issue:
Expected behavior
When there are no circular relationships in the database schema, I expect to be able to reference models from different modules using string references (without importing them explicitly) without encountering ForwardRef errors.
Additional context
This error occurs when defining Link references across modules. Ideally, forward references should allow linking models without circular imports. This behavior is necessary when defining related models in separate files.
The text was updated successfully, but these errors were encountered:
I don't have a solution, but I’m interested in how you fetch a Comment or Post, and whether the User is populated. When I fetch, for example, a Comment, I only get the ObjectId of the User or Post, but not the actual data from the Post or User document.
I have the feeling that find with fetch_links=True is not working correctly.
Describe the bug
Unable to use string references with
Link
across different modules. When using string references forLink
without importing the actual model classes (i.e., relying on forward references), aForwardRef
error is raised. This issue arises when models from different modules reference each other.To Reproduce
Provide the following code snippet to reproduce the issue:
Expected behavior
When there are no circular relationships in the database schema, I expect to be able to reference models from different modules using string references (without importing them explicitly) without encountering
ForwardRef
errors.Additional context
This error occurs when defining
Link
references across modules. Ideally, forward references should allow linking models without circular imports. This behavior is necessary when defining related models in separate files.The text was updated successfully, but these errors were encountered: