Replies: 1 comment 2 replies
-
We’re encountering the exact same issue. Initially, we thought it was related to SQLAlchemy itself, but after extensive debugging, we found that it only happens when implementing our models with SQLModel. The same logic works fine when using SQLAlchemy directly. |
Beta Was this translation helpful? Give feedback.
2 replies
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
Im running very simple example code (basically taken from tutorial.
I thought there are 2 ways of creating relationship.- using
team
orteam_id
(One hero instance creating is commented out).The problem is that when I run the code above, Relationship is not created, and team_id of object hero_db is NULL.
Removing model_validate from the code resolves the problem, but in more complex examples, it is required to properly parse input.
Am I doing something wrong or is it really bad bug? Because I cant imagine passing the entire objects instead of IDs is a must for bigger objects.
Operating System
macOS
Operating System Details
No response
SQLModel Version
Name: sqlmodel Version: 0.0.22
Python Version
Python 3.12.7
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions