mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-02 08:29:21 +00:00
refactor: 重构模型加载选项和CRUD预加载逻辑 fix: 修复日期范围查询格式问题 style: 优化前端组件样式和布局 perf: 提升字典数据更新性能 docs: 更新注释和文档说明 chore: 清理无用文件和代码 test: 更新测试用例 build: 添加vue-json-pretty依赖 ci: 优化初始化脚本和事务处理
31 lines
953 B
Python
31 lines
953 B
Python
# -*- coding: utf-8 -*-
|
|
"""
|
|
岗位模型模块
|
|
定义岗位相关数据模型
|
|
"""
|
|
|
|
from typing import List
|
|
|
|
from sqlalchemy import Boolean, String, Integer
|
|
from sqlalchemy.orm import relationship, Mapped, mapped_column
|
|
|
|
from app.core.base_model import CreatorMixin
|
|
|
|
|
|
class PositionModel(CreatorMixin):
|
|
"""
|
|
岗位模型
|
|
"""
|
|
__tablename__ = "system_position"
|
|
__table_args__ = ({'comment': '岗位表'})
|
|
__loader_options__ = ["creator"]
|
|
|
|
name: Mapped[str] = mapped_column(String(40), nullable=False, unique=True, comment="岗位名称")
|
|
order: Mapped[int] = mapped_column(Integer, nullable=False, default=1, comment="显示排序")
|
|
status: Mapped[bool] = mapped_column(Boolean(), default=True, nullable=False, comment="是否启用(True:启用 False:禁用)")
|
|
|
|
# 用户关联关系
|
|
users: Mapped[List["UserModel"]] = relationship(secondary="system_user_positions", back_populates="positions", lazy="selectin")
|
|
|
|
|