users repository
This commit is contained in:
parent
b4d44e7bfd
commit
6b0a5a7b65
@ -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
|
||||
|
||||
class UserRepository(AbstractRepository[User]):
|
||||
class Meta:
|
||||
collection_name = "users"
|
Loading…
x
Reference in New Issue
Block a user