1/app/api/v1/schemas/comments.py
2025-03-20 10:46:50 +01:00

14 lines
346 B
Python

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