learn-sql-model/learn_sql_model/models.py
2023-05-19 20:37:42 -05:00

15 lines
416 B
Python

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")