users repository
This commit is contained in:
parent
b4d44e7bfd
commit
6b0a5a7b65
@ -1,18 +1,22 @@
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
from pydantic_mongo import AbstractRepository, ObjectIdField
|
||||||
|
|
||||||
class User(BaseModel):
|
class User(BaseModel):
|
||||||
id: int
|
id: ObjectIdField = None
|
||||||
username: str
|
username: str
|
||||||
password: str
|
password: str
|
||||||
roles: str
|
roles: str
|
||||||
disabled: bool
|
disabled: bool
|
||||||
|
|
||||||
class UserOut(BaseModel):
|
class UserOut(BaseModel):
|
||||||
id: int
|
id: ObjectIdField = None
|
||||||
username: str
|
username: str
|
||||||
roles: str
|
roles: str
|
||||||
disabled: bool
|
disabled: bool
|
||||||
|
|
||||||
class UserInDB(User):
|
class UserInDB(User):
|
||||||
password: str
|
password: str
|
||||||
|
|
||||||
|
class UserRepository(AbstractRepository[User]):
|
||||||
|
class Meta:
|
||||||
|
collection_name = "users"
|
Loading…
x
Reference in New Issue
Block a user