Gurucool_Test / cruds /user_permission.py
ashwinR's picture
Upload 245 files
b7a7f32
raw
history blame contribute delete
528 Bytes
from cruds.base import CRUDBase
from schemas.user_permission import UserPermissionCreate, UserPermissionUpdate
from models.user_permission import UserPermission
from models import User
from sqlalchemy.orm import Session
class CRUDUserPermission(
CRUDBase[UserPermission, UserPermissionCreate, UserPermissionUpdate]
):
def get_by_name(
self, db: Session, *, name: str
):
return db.query(self.model).filter(self.model.name == name).first()
crud_user_permission = CRUDUserPermission(UserPermission)