mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-22 13:05:18 +00:00
- Added a "Start Here" section in both English and Chinese README files to guide new users on running the project locally and exploring its features. - Introduced backend conventions for date and serialization handling, clarifying the use of Pydantic v2 and PostgreSQL. - Updated the "Quick Start" section with detailed steps for first-time local setup, including environment requirements and backend setup instructions. - Improved overall structure and clarity of documentation to facilitate better understanding for developers and contributors.
26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
from sqlalchemy import JSON, String, UniqueConstraint
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.base_model import ModelMixin, UserMixin
|
|
|
|
|
|
class WorkflowModel(ModelMixin, UserMixin):
|
|
"""
|
|
工作流定义:Vue Flow 画布序列化 + Prefect 运行时执行
|
|
"""
|
|
|
|
__tablename__: str = "task_workflow"
|
|
__table_args__ = (UniqueConstraint("code", name="uq_task_workflow_code"), {"comment": "工作流定义表"})
|
|
__loader_options__: list[str] = ["created_by", "updated_by"]
|
|
|
|
name: Mapped[str] = mapped_column(String(128), nullable=False, comment="流程名称")
|
|
code: Mapped[str] = mapped_column(String(64), nullable=False, comment="流程编码")
|
|
workflow_status: Mapped[str] = mapped_column(
|
|
String(32),
|
|
nullable=False,
|
|
default="draft",
|
|
comment="流程状态: draft/published/archived",
|
|
)
|
|
nodes: Mapped[list | None] = mapped_column(JSON, nullable=True, comment="Vue Flow nodes JSON")
|
|
edges: Mapped[list | None] = mapped_column(JSON, nullable=True, comment="Vue Flow edges JSON")
|