mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 12:52:26 +00:00
refactor(base_crud): 优化数据权限过滤逻辑 fix(user): 修正用户详情部门查询错误 feat(menu): 添加菜单标题字段并优化路由更新 style(auth): 优化登录页面背景样式 fix(profile): 修复表单样式问题 perf(redis): 优化缓存清除逻辑 fix(role): 移除默认角色操作限制 chore: 清理无用导入和注释
42 lines
1.5 KiB
Python
42 lines
1.5 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from datetime import datetime
|
|
from sqlalchemy import Column, String, Integer, DateTime, ForeignKey, Text, Boolean
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from app.core.base_model import ModelBase
|
|
|
|
|
|
class ConfigModel(ModelBase):
|
|
"""
|
|
配置表 - 用于存储组织架构中的配置信息
|
|
"""
|
|
__tablename__ = "system_config"
|
|
__table_args__ = ({'comment': '配置表'})
|
|
|
|
# 基础字段
|
|
id = Column(Integer, primary_key=True, autoincrement=True, comment='主键ID')
|
|
config_name = Column(String(500), nullable=True, unique=True, default='', comment='参数名称')
|
|
config_key = Column(String(500), nullable=True, unique=True, default='', comment='参数键名')
|
|
config_value = Column(String(500), nullable=True, default='', comment='参数键值')
|
|
config_type = Column(Boolean, default=False, nullable=False, comment="系统内置((True:是 False:否))")
|
|
|
|
# 审计字段
|
|
description = Column(Text, nullable=True, comment="备注说明")
|
|
created_at = Column(DateTime, default=datetime.now, comment='创建时间')
|
|
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now, comment='更新时间')
|
|
creator_id = Column(
|
|
Integer,
|
|
ForeignKey("system_users.id", ondelete="SET NULL", onupdate="CASCADE"),
|
|
nullable=True,
|
|
index=True,
|
|
comment="创建人ID"
|
|
)
|
|
creator = relationship(
|
|
"UserModel",
|
|
foreign_keys=creator_id,
|
|
lazy="selectin",
|
|
post_update=True,
|
|
uselist=False
|
|
)
|