Replies: 1 comment
-
In Issues, a search for "issubclass" will show others are in the same boat There are many open issues discussing this issue: sqlmodel#57 sqlmodel#67 sqlmodel#121 sqlmodel#312 Besides the many open issues, there is a PR that would fix this pull/862 Sadly SQLModel maintenance is not occurring in a timely manner. PRs are languishing forever. There are no good options. A deeply disturbing option is to roll up your sleeves, applying all the important PRs to your own fork. Almost everyone in this community is capable of applying all the PRs in a fork. Just comes down to motivating someone by pelting them with cash. And thinking of a new package name, rather than SQLModel. Whomever is the target of the mass pelting, they should bring on other maintainers so as not to fall into the same trap. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
🧭 Context / Goal
I define type aliases using typing.Annotated + pydantic.Field(...) to keep all validation rules and descriptions in one place.
I want to:
This worked until I hit a runtime error once I started using those aliases directly on ORM fields.
Traceback (shortened):
If I replace CreatedByUserId with plain UUID in the ORM model, it works (but I lose my DRY metadata).
🔍 What’s really happening
✅ What I already tried
❓ What I’m asking
💡 Desired outcome
🗂️ Bigger picture (why I care)
I want to keep:
…and use it everywhere:
This gives my service layer (and even UI scaffolding) access to the same description without copying it around.
When I switch to plain str in the ORM model, I lose that Field metadata on the ORM instance and have to duplicate it on the DTOs or somewhere else.
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.0.24
Python Version
3.12
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions