from pydantic import BaseModel from typing import Optional class CommentsBase(BaseModel): body: str post_id: int user_id: int class Comments(CommentsBase): id: int post_id: int user_id: int class Config: orm_mode = True