Manually Specifying a ForeignKey breaks fastapi #694
Replies: 1 comment
-
| Works fine in current version (0.0.24): |
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.
-
First Check
Commit to Help
Example Code
Description
I'm trying to add extra properties to the
ForeignKeydefinition for my fields. (Specifically,deferrableandinitially) To define those properties, I have to change to specifysa_column_argsto define theForeignKeymanually. This works fine, until you try to use the model in a FastAPI application, at which point the app doesn't even start up.It seems like FastAPI ends up affecting the sqlalchemy side of the model when it does the create_cloned_field rather than just the pydantic part.
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.11
Python Version
3.10.11
Additional Context
fastapi 0.104.1
Beta Was this translation helpful? Give feedback.
All reactions