from pydantic import BaseModel
from typing import Optional

class PostsBase(BaseModel):
    title: str
    content: str
    published: bool = True
    rating: Optional[int] = None

class Posts(PostsBase):
    id: int
    owner_id: int

    class Config:
        orm_mode = True