14 lines
310 B
Python
14 lines
310 B
Python
from pydantic import BaseModel
|
|
from app.db.base import Base
|
|
from typing import Optional
|
|
class AndBase(BaseModel):
|
|
title: str
|
|
content: str
|
|
class AndCreate(AndBase):
|
|
pass
|
|
class And(AndBase):
|
|
id: int
|
|
is_published: bool
|
|
rating: Optional[int] = None
|
|
class Config:
|
|
orm_mode = True |