21 lines
696 B
Python
21 lines
696 B
Python
#!/usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
# @version : 1.0
|
|
# @Create Time : 2025/04/03 10:28
|
|
# @File : project_label.py
|
|
# @IDE : PyCharm
|
|
# @desc : pydantic 模型,用于数据库序列化操作
|
|
|
|
from pydantic import BaseModel, Field, ConfigDict
|
|
from typing import Optional
|
|
|
|
|
|
class ProjectLabel(BaseModel):
|
|
"""项目标签输入输出"""
|
|
id: Optional[int] = Field(None, description="id")
|
|
project_id: Optional[int] = Field(None, description="项目id")
|
|
label_name: Optional[str] = Field(..., description="标签名称")
|
|
meta: Optional[dict] = Field(None, description="label属性")
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|