news & things
This commit is contained in:
22
backend/app/views/news/schemas.py
Normal file
22
backend/app/views/news/schemas.py
Normal file
@ -0,0 +1,22 @@
|
||||
from typing import Union
|
||||
from pydantic import BaseModel
|
||||
from uuid import UUID
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class CreateNews(BaseModel):
|
||||
title: str
|
||||
content: str
|
||||
|
||||
|
||||
class News(BaseModel):
|
||||
title: str
|
||||
content: str
|
||||
created: datetime
|
||||
|
||||
|
||||
class NewsInDb(News):
|
||||
id: UUID
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user