users repository

This commit is contained in:
Valentin CZERYBA 2023-10-13 18:17:38 +02:00
parent b4d44e7bfd
commit 6b0a5a7b65

View File

@ -1,18 +1,22 @@
from pydantic import BaseModel
from pydantic_mongo import AbstractRepository, ObjectIdField
class User(BaseModel):
id: int
id: ObjectIdField = None
username: str
password: str
roles: str
disabled: bool
class UserOut(BaseModel):
id: int
id: ObjectIdField = None
username: str
roles: str
disabled: bool
class UserInDB(User):
password: str
password: str
class UserRepository(AbstractRepository[User]):
class Meta:
collection_name = "users"