backend/med_backend/posts/schemas.py
2022-12-09 16:40:14 +03:00

28 lines
386 B
Python

from pydantic import BaseModel
from med_backend.auth.schemas import UserPublicInfo
class BasePost(BaseModel):
name: str
class PostCreate(BasePost):
description: str
class PostList(BasePost):
id: int
class Config:
orm_mode = True
class Post(BasePost):
id: int
description: str
user: UserPublicInfo
class Config:
orm_mode = True