Best way to do polymorphism / tagged unions with an object in a field in an SQLModel? #1450
Unanswered
PhilippeGSK
asked this question in
Questions
Replies: 1 comment
-
(I clicked one of the checkmarks to see what it would do I didn't think it would edit it) |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
I'm making a small chat feature.
I'm trying to create a system where a field (data) in my SQLModel table (ChannelMessage) gets populated differently based on a type string. My current setup is in the code above. It works. I was wondering, though, if there were any cleaner and more automated ways to achieve the same result. I'm kind of new to the world of ORMs and things like that in general so I don't know about all the possibilities.
Operating System
Linux
Operating System Details
Debian GNU/Linux 12 (bookworm) x86_64
SQLModel Version
0.0.24
Python Version
Python 3.13.5
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions