-
-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
questionFurther information is requestedFurther information is requested
Description
First Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn't find it.
- I searched the SQLModel documentation, with the integrated search.
- I already searched in Google "How to X in SQLModel" and didn't find any information.
- I already read and followed all the tutorial in the docs and didn't find an answer.
- I already checked if it is not related to SQLModel but to Pydantic.
- I already checked if it is not related to SQLModel but to SQLAlchemy.
Commit to Help
- I commit to help with one of those options 👆
Example Code
from tortoise.models import Model
from tortoise.fields import UUIDField, DatetimeField,CharField, BooleanField, JSONField, ForeignKeyField, CharEnumField, IntField
from tortoise.contrib.pydantic import pydantic_model_creator
class Schedule(Model):
id = UUIDField(pk=True)
created_at = DatetimeField(auto_now_add=True)
modified_at = DatetimeField(auto_now=True)
case = JSONField()
type = CharEnumField(SchemasEnum,description='Schedule Types')
username = ForeignKeyField('models.Username')
description = CharField(100)
schedule_pydantic = pydantic_model_creator(Schedule,name='Schedule')
Description
I have already implemented an API using FastAPI to store Pydantic Models. These models are themselves nested Pydantic models so the way they interact with a Postgres DataBase is throught JsonField. I've been using Tortoise ORM as the example shows.
Is there an equivalent model in SQLModel?
Operating System
Linux
Operating System Details
WSL 2 Ubuntu 20.04
SQLModel Version
0.0.4
Python Version
3.8
Additional Context
No response
andrewbolster, duyuxuan, OXERY, dannymandel, ademoverflow and 27 more
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested