Files
2026-09-08 11:00:05 +05:30

29 lines
847 B
Python

from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
class VersionCreateIn(BaseModel):
changes_description: str = Field(default="Updated version", min_length=1, max_length=1000)
markdown_content: Optional[str] = Field(default=None, max_length=10_485_760)
xml_content: Optional[str] = Field(default=None, max_length=10_485_760)
html_content: Optional[str] = Field(default=None, max_length=10_485_760)
session_id: Optional[str] = None
class VersionUpdateIn(BaseModel):
changes_description: str = Field(min_length=1, max_length=1000)
class VersionOut(BaseModel):
id: int
project_id: int
version_number: int
changes_description: Optional[str]
is_current: bool
created_by_id: int
created_at: datetime
class Config:
from_attributes = True