File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 1- from typing import Optional , List
21from pydantic import BaseModel , EmailStr
32
4- from models .events import Event
53
64
75class User (BaseModel ):
86 email : EmailStr
97 password : str
10- events : Optional [List [Event ]]
118
129 class Config :
1310 schema_extra = {
1411 "example" : {
1512 "email" : "fastapi@packt.com" ,
1613 "password" : "strong!!!" ,
17- "events" : [],
1814 }
1915 }
2016
@@ -28,4 +24,4 @@ class UserSignIn(BaseModel):
2824 "email" : "fastapi@packt.com" ,
2925 "password" : "strong!!!"
3026 }
31- }
27+ }
Original file line number Diff line number Diff line change 1- from typing import Optional , List
2- from beanie import Document , Link
1+ from beanie import Document
32
43from pydantic import BaseModel , EmailStr
54
6- from models .events import Event
75
86
97class User (Document ):
108 email : EmailStr
119 password : str
12- events : Optional [List [Link [Event ]]]
1310
1411 class Collection :
1512 name = "users"
@@ -19,7 +16,6 @@ class Config:
1916 "example" : {
2017 "email" : "fastapi@packt.com" ,
2118 "password" : "strong!!!" ,
22- "events" : [],
2319 }
2420 }
2521
You can’t perform that action at this time.
0 commit comments