Replies: 2 comments 1 reply
-
jonra1993/fastapi-alembic-sqlmodel-async#46 The same issue is also mentioned here. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey, anyway I fixed my issue by noticing that validations belong to pydantic's "schema" instead of sqlalchemy's "model", hence, the |
Beta Was this translation helpful? Give feedback.
1 reply
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
BaseIDModel
which does nothing but provides aid
field for other models to inherit from.ProjectBase
functions likeHeroBase
in the tutorials/documentations, providing the essential fields to the eventualtable
.Project
is a table.IProjectCreate
is a schema (pydantic's model) for the creation ofProject
object via an API.repr_name
field is a slugified representation of thename
field inProjectBase
.repr_name
properly slugified before insertion into the database.IProjectCreate(name='Hello A')
which is handled by the API (not shown but easily appreciated), the codes callProject.from_orm(IProjectCreate(name='Hello A'))
to convert theschema
object into adatabase-orm
object.slugify_name(..., values)
, thevalues
dictionary does not contain the keyname
.Operating System
Windows
Operating System Details
Local machine is Windows but running the FastAPI application via docker, i.e. Linux OS.
SQLModel Version
'0.0.6'
Python Version
Python 3.10.6
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions