mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-23 05:10:57 +00:00
refactor(model): 优化示例表及代码生成表模型定义
- 统一示例表注释格式,去除兼容说明 - 取消 GenTableModel 和 GenTableColumnModel 中的 @declared_attr 装饰器,改用类属性定义表名和表注释 - 移除 GenTableModel 中冗余字段定义如删除标志、创建人、更新时间等,简化模型 - 调整字段 table_id 顺序至 GenTableColumnModel 中末尾,保证定义统一 - 修改导入的 sqlalchemy 模块,去除未使用的类型和方法 - 在 GenTableColumnBaseSchema 中添加 create_by 字段,完善字段信息描述
This commit is contained in:
@@ -9,8 +9,7 @@ from app.core.base_model import CreatorMixin
|
||||
|
||||
class DemoModel(CreatorMixin):
|
||||
"""
|
||||
示例表 - SQLAlchemy 2.0 语法
|
||||
兼容 MySQL 和 PostgreSQL
|
||||
示例表
|
||||
"""
|
||||
__tablename__ = 'example_demo'
|
||||
__table_args__ = ({'comment': '示例表'})
|
||||
|
||||
Reference in New Issue
Block a user