mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-23 21:18:09 +00:00
重构示例模块为代码生成模块,包括新增模型、服务、控制器等核心组件 更新数据库配置从MySQL切换为PostgreSQL并调整相关参数 优化代码生成模板逻辑,移除无用字段和功能 添加PostgreSQL菜单SQL生成测试用例 更新前端API路径和菜单配置 移除旧的示例模块相关代码
18 lines
499 B
Python
18 lines
499 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
from sqlalchemy import String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.base_model import ModelMixin, UserMixin
|
|
|
|
|
|
class DemoModel(ModelMixin, UserMixin):
|
|
"""
|
|
示例表
|
|
"""
|
|
__tablename__: str = 'gen_demo'
|
|
__table_args__: dict[str, str] = ({'comment': '示例表'})
|
|
__loader_options__: list[str] = ["created_by", "updated_by"]
|
|
|
|
name: Mapped[str | None] = mapped_column(String(64), nullable=True, default='', comment='名称')
|