Pipelinen parannuksia building blockeilla
This commit is contained in:
35
zipit/template_runs/tmpl_blog/schemas.py
Normal file
35
zipit/template_runs/tmpl_blog/schemas.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from pydantic import BaseModel
|
||||
from datetime import date
|
||||
|
||||
class UserCreate(BaseModel):
|
||||
username: str
|
||||
email: str
|
||||
password_hash: str
|
||||
|
||||
class UserResponse(UserCreate):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class ArticleCreate(BaseModel):
|
||||
title: str
|
||||
content: str
|
||||
author_id: int
|
||||
|
||||
class ArticleResponse(ArticleCreate):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
class CommentCreate(BaseModel):
|
||||
content: str
|
||||
article_id: int
|
||||
author_id: int
|
||||
|
||||
class CommentResponse(CommentCreate):
|
||||
id: int
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
Reference in New Issue
Block a user