mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-23 13:13:09 +00:00
refactor(tenant): 移除租户工具模块并优化相关代码
重构租户模块,删除不再使用的工具类文件,包括查询、写入、缓存键等功能 优化模型字段格式和CRUD方法顺序,调整前端暗黑模式颜色变量 简化租户服务逻辑,移除平台租户管理校验,改进初始管理员创建流程
This commit is contained in:
@@ -32,7 +32,7 @@ class {{ class_name }}Model(ModelMixin, UserMixin):
|
||||
{% if column.column_name not in ['id', 'uuid', 'status', 'description', 'created_time', 'updated_time', 'created_id', 'updated_id'] %}
|
||||
{% set sqlalchemy_type = column|get_sqlalchemy_type %}
|
||||
{% if column.column_name == sub_table_fk_name %}
|
||||
{{ column.column_name }}: Mapped[{{ column.python_type }} | None] = mapped_column(ForeignKey('{{ parent_table_name }}.{{ parent_pk_column_name }}', ondelete='CASCADE'), {{ sqlalchemy_type }}, {% if column.is_pk %}primary_key=True, {% endif %}{% if column.is_increment %}autoincrement=True, {% endif %}{% if (not column.is_nullable) or column.is_pk %}nullable=False{% else %}nullable=True{% endif %}, comment='{{ column.column_comment }}')
|
||||
{{ column.column_name }}: Mapped[{{ column.python_type }} | None] = mapped_column({{ sqlalchemy_type }}, ForeignKey('{{ parent_table_name }}.{{ parent_pk_column_name }}', ondelete='CASCADE'), {% if column.is_pk %}primary_key=True, {% endif %}{% if column.is_increment %}autoincrement=True, {% endif %}{% if (not column.is_nullable) or column.is_pk %}nullable=False{% else %}nullable=True{% endif %}, comment='{{ column.column_comment }}')
|
||||
{% else %}
|
||||
{{ column.column_name }}: Mapped[{{ column.python_type }} | None] = mapped_column({{ sqlalchemy_type }}, {% if column.is_pk %}primary_key=True, {% endif %}{% if column.is_increment %}autoincrement=True, {% endif %}{% if (not column.is_nullable) or column.is_pk %}nullable=False{% else %}nullable=True{% endif %}, comment='{{ column.column_comment }}')
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user