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

18 lines
364 B
Python
Raw Normal View History

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