You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, in a 1-to-many scenario, if I want to create a foreign key, I need to specify it with a string. (the Current class in the example)
I would like to do it passing "directly" the field (the Desiderata).
Keep in mind that I want to support both ways, I know there are cases when the relationship is not so simple, but I would like to have the simple case (that is the most common in my experience) to just be simpler
FWIW at the moment I have a very simple function that offer me this kind of behavior:
As an addendum: now the Desiderata class raises an AssertionError (as there is an assert isinstance(foreign_key, str)) so this change shouldn't create any kind of back compatibility
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
Description
At the moment, in a 1-to-many scenario, if I want to create a foreign key, I need to specify it with a string. (the
Current
class in the example)I would like to do it passing "directly" the field (the
Desiderata
).Keep in mind that I want to support both ways, I know there are cases when the relationship is not so simple, but I would like to have the simple case (that is the most common in my experience) to just be simpler
FWIW at the moment I have a very simple function that offer me this kind of behavior:
but I would like to have this supported natively.
As an addendum: now the
Desiderata
class raises anAssertionError
(as there is anassert isinstance(foreign_key, str)
) so this change shouldn't create any kind of back compatibilityOperating System
macOS
Operating System Details
No response
SQLModel Version
0.0.14
Python Version
3.12
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions