-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.py
More file actions
61 lines (43 loc) · 1.06 KB
/
user.py
File metadata and controls
61 lines (43 loc) · 1.06 KB
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
58
59
60
61
from datetime import date, datetime
from pydantic import BaseModel, Field, EmailStr
from typing import Optional, Union
class UserBase(BaseModel):
name: str = Field()
birthday: date
username: str = Field(min_length=3)
email: EmailStr
password: str = Field(min_length=5)
class UserDisplay(BaseModel):
username: Optional[str]
id: int
email: Optional[str]
class Config:
orm_mode = True
class UserProfileDisplay(BaseModel):
username: Optional[str]
email: Optional[str]
birthday: Optional[date]
name: Optional[str]
created_at: Optional[datetime]
tweets_count: Optional[int]
class Config:
orm_mode = True
class UserProfileResponse(BaseModel):
id: int
username: str
name: str
description: Optional[str]
class Config:
orm_mode = True
class UserAuth(BaseModel):
id: int
username: str
email: str
class Config:
orm_mode = True
class UserInTweet(BaseModel):
id: int
username: str
name: str
class Config:
orm_mode = True