from pydantic import BaseModel
from typing import Optional

class TagsBase(BaseModel):
    name: str

class Tags(TagsBase):
    id: int
    posts: Optional[list]

    class Config:
        orm_mode = True