diff --git a/app/models/users.py b/app/models/users.py index 36e15b1..743a924 100644 --- a/app/models/users.py +++ b/app/models/users.py @@ -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 \ No newline at end of file + password: str + +class UserRepository(AbstractRepository[User]): + class Meta: + collection_name = "users" \ No newline at end of file