model.py 519 B

123456789101112131415161718
  1. from sqlalchemy import String
  2. from sqlalchemy.orm import Mapped, mapped_column
  3. from app.core.base_model import ModelMixin, UserMixin
  4. class Demo01Model(ModelMixin, UserMixin):
  5. """
  6. 示例表 - 涵盖大多数常用数据类型
  7. """
  8. __tablename__: str = "gen_demo01"
  9. __table_args__: dict[str, str] = {"comment": "示例1表"}
  10. __loader_options__: list[str] = ["created_by", "updated_by"]
  11. # 字符串类型
  12. name: Mapped[str] = mapped_column(String(64), nullable=False, comment="名称")