from typing import Optional from datetime import datetime from pydantic import BaseModel class CommentsCreate(BaseModel): text: str post_id: int user_id: int class Comments(BaseModel): id: int text: str post_id: int user_id: int created_at: datetime updated_at: Optional[datetime] = None class Config: orm_mode = True