3/app/api/v1/schemas/comments.py
2025-03-20 12:49:08 +01:00

16 lines
365 B
Python

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