14 lines
346 B
Python
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 |