Replies: 3 comments
-
I guess not. explicity is always better than implicity. Also, it's not woring on async session. Use |
Beta Was this translation helpful? Give feedback.
0 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
If SQLModel serialized relationships by default, you would have an infinite loop with the models you shared. I guess it's probably possible to come up with solution how to serialize relationships but prevent infinite loops. If you have such ideas - feel free to share! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
The code above works fine, but does not return nested dictonary with search relationship. If I simply create
and change response_model to VideoResponse, everything works as I wish. However it brings some redundancy, which in fact SQLModel aims to remove. Would it be possible to make SQLModel serialize the relationship by default?
Operating System
Linux
Operating System Details
No response
SQLModel Version
sqlmodel==0.0.14
Python Version
3.11.4
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions