PIbd-32_Kashin_M.I_API_Cour.../schemas.py

20 lines
425 B
Python
Raw Normal View History

from typing import Optional
from pydantic import BaseModel, ConfigDict
from datetime import datetime
class SQuestionAdd(BaseModel):
email_user: str
type_question: bool
question: str
class SQuestion(SQuestionAdd):
id: int
answer: Optional[str] = None
question_time: datetime
model_config = ConfigDict(from_attributes=True)
class SQuestionId(BaseModel):
ok: bool = True
question_id: int