Files
DjangoAdmin_FastAPI_EleVue/apps/forms/dict.py
T
ClaudeandClaude dbcce79536 chore: 基线提交(重构前快照)
重构前保存现有 apps/ 结构基线,供后续各阶段回滚。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-07 09:43:18 +08:00

13 lines
500 B
Python

from typing import Optional
from pydantic import BaseModel, Field
# 字典表单验证
class DictForm(BaseModel):
id: Optional[int] = Field(None, description="字典ID")
name: str = Field(..., min_length=1, max_length=150, description="字典名称")
code: str = Field(..., min_length=1, max_length=150, description="字典编码")
sort: int = Field(..., ge=0, le=99999, description="字典排序")
note: Optional[str] = Field(None, max_length=255, description="字典备注")