from pydantic import BaseModel, EmailStr, Field from datetime import date class UserCreate(BaseModel): username: str email: EmailStr password: str password_repeat: str dob: date country_of_origin: str @property def passwords_match(self): return self.password == self.password_repeat class UserLogin(BaseModel): username: str password: str class Token(BaseModel): access_token: str token_type: str