model.py 499 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from sqlalchemy import String
  3. from sqlalchemy.orm import Mapped, mapped_column
  4. from app.core.base_model import ModelMixin, UserMixin
  5. class DemoModel(ModelMixin, UserMixin):
  6. """
  7. 示例表
  8. """
  9. __tablename__: str = 'gen_demo'
  10. __table_args__: dict[str, str] = ({'comment': '示例表'})
  11. __loader_options__: list[str] = ["created_by", "updated_by"]
  12. name: Mapped[str | None] = mapped_column(String(64), nullable=True, default='', comment='名称')