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