Skip to content

Fix one-to-many relation create/edit with SQLAlchemy#707

Open
tmshlvck wants to merge 1 commit into
jowilf:mainfrom
tmshlvck:main
Open

Fix one-to-many relation create/edit with SQLAlchemy#707
tmshlvck wants to merge 1 commit into
jowilf:mainfrom
tmshlvck:main

Conversation

@tmshlvck

@tmshlvck tmshlvck commented Sep 16, 2025

Copy link
Copy Markdown

One-to-many relations do not automatically fill the relation_id foreign key, which causes 422 errors propagation with no save to the DB

By this patch we bind the foreign key column with the relation "virutal" column in SQLModel / SQLAlchemy - the name of the foreign key has to be "_id", which corresponds with the existing documentation.

This closes #485 and probably two related/duplicate issues.

One-to-many relations do not automatically fill the relation_id foreign
key, which causes 422 errors propagation with no save to the DB

By this patch we bind the foreign key column with the relation "virutal"
column in SQLModel / SQLAlchemy - the name of the foreign key has to be
"<relation>_id", which corresponds with the existing documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Required foreign key is empty

1 participant