Manually Specifying a ForeignKey breaks fastapi #694
Unanswered
gazpachoking
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
I'm trying to add extra properties to the
ForeignKey
definition for my fields. (Specifically,deferrable
andinitially
) To define those properties, I have to change to specifysa_column_args
to define theForeignKey
manually. 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