-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
57 lines (39 loc) · 838 Bytes
/
schemas.py
File metadata and controls
57 lines (39 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from pydantic import BaseModel
from typing import List
class Articles(BaseModel):
title: str
content: str
published: bool
class Config():
orm_mode = True
class UserBase(BaseModel):
username: str
email: str
password: str
class UserDisplay(BaseModel):
username: str
email: str
items: List[Articles] = []
class Config():
orm_mode = True
class ArticleBase(BaseModel):
title: str
content: str
published: bool
creator_id: int
class User(BaseModel):
id: int
username: str
class Config():
orm_mode = True
class ArticleDisplay(BaseModel):
title: str
content: str
published: bool
user: User
class Config():
orm_mode = True
class ProductBase(BaseModel):
title: str
description: str
price: float