wip
This commit is contained in:
parent
c238b9d757
commit
fcc0698aeb
12 changed files with 95 additions and 97 deletions
15
learn_sql_model/models.py
Normal file
15
learn_sql_model/models.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from learn_sql_model.models.fast_model import FastModel
|
||||
from sqlmodel import Field
|
||||
|
||||
|
||||
class Hero(FastModel, table=True):
|
||||
id: Optional[int] = Field(default=None, primary_key=True)
|
||||
name: str
|
||||
secret_name: str
|
||||
age: Optional[int] = None
|
||||
# new_attribute: Optional[str] = None
|
||||
# pets: List["Pet"] = Relationship(back_populates="hero")
|
||||
Loading…
Add table
Add a link
Reference in a new issue