app.crud package¶
Submodules¶
app.crud.base module¶
- class app.crud.base.ModelBase(model: type[ModelType])[source]¶
Bases:
Generic
[ModelType
,CreateSchemaType
,UpdateSchemaType
]
app.crud.user module¶
- class app.crud.user.UserModel(model: type[ModelType])[source]¶
Bases:
ModelBase
[User
,UserCreate
,UserUpdate
]Class that wraps the User model.
- authenticate(db: Session, *, user_name: str, password: str) User | None [source]¶
Determine if a user exists by the user name and checking the password.
- create(db: Session, *, obj_in: UserCreate) User [source]¶
Create a new user object.
- get_by_username(db: Session, *, user_name: str) User | None [source]¶
Get a user by username from the database.
- update(db: Session, *, db_obj: User, obj_in: UserUpdate | dict[str, Any]) User [source]¶
Update a user.
Module contents¶
Last update:
Mar 10, 2024