mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-23 13:33:08 +00:00
* Refactor foreign keys and relationships to pure logic * Revert of some changes * More revert * Update the user paginate * Update user create and update * Update dept select and delete * Rename the join query functions * Update select_join_serialize doc and README * Fix typo in README * Update the user delete * Update the user social * Update the dict plugin crud * Update the dict plugin version * Bump dependencies and pre-commits * Update the code generator plugin crud * Update the menu crud * Update the role crud * Update the data scope and rule crud * Restore get_paginated to get_select * Update the code generator plugin version * Add the py version in pre-commit * Remove the plugin include parameter config * Add more cache cleaning TODO * Rename get_with_relation to get_join * Add the user cache clear * Fix known compatibility issues * Update the version number to 1.11.0 * Fix lint * Optimize select_join_serialize logic * Delete cache cleanup comments * Update the oauth2 plugin version * Fix user-role table cleanup when user update
22 lines
823 B
Python
22 lines
823 B
Python
import sqlalchemy as sa
|
||
|
||
from sqlalchemy.orm import Mapped, mapped_column
|
||
|
||
from backend.common.model import Base, id_key
|
||
|
||
|
||
class DataRule(Base):
|
||
"""数据规则表"""
|
||
|
||
__tablename__ = 'sys_data_rule'
|
||
|
||
id: Mapped[id_key] = mapped_column(init=False)
|
||
name: Mapped[str] = mapped_column(sa.String(512), unique=True, comment='名称')
|
||
model: Mapped[str] = mapped_column(sa.String(64), comment='模型名称')
|
||
column: Mapped[str] = mapped_column(sa.String(32), comment='模型字段名')
|
||
operator: Mapped[int] = mapped_column(comment='运算符(0:and、1:or)')
|
||
expression: Mapped[int] = mapped_column(
|
||
comment='表达式(0:==、1:!=、2:>、3:>=、4:<、5:<=、6:in、7:not_in)',
|
||
)
|
||
value: Mapped[str] = mapped_column(sa.String(256), comment='规则值')
|