-
Notifications
You must be signed in to change notification settings - Fork 0
/
schemas.py
48 lines (32 loc) · 827 Bytes
/
schemas.py
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
from datetime import datetime
from pydantic import BaseModel, EmailStr
from typing import Optional
class Todo(BaseModel):
title: str
detail: Optional[str] = None
is_done: bool = False
remind_on: datetime = None
class Config:
orm_mode = True
class UserBase(BaseModel):
username: str
email: EmailStr
name: str
class User(UserBase):
telegram_id: Optional[int] = None
class Config:
orm_mode = True
class UserSignup(UserBase):
password: str
class UserLogin(BaseModel):
username: str
password: str
class UserEdit(BaseModel):
username: Optional[str] = None
email: Optional[EmailStr] = None
name: Optional[str] = None
class OTP(BaseModel):
telegram_id: int
pin: int
expiry: float # UNIX timestamp
authorized: bool = False