app/modules/users/services.py
def delete(self, db: Session, id: int) -> UserResponse:
        """
        Deletes an user by id.

        Args:
            id (int): The user ID.

        Returns:
            UserResponse: The User Response model.
        """        
        db_user = db.query(User).filter(and_(
            User.id == id,
            User.is_deleted == False
        )).first()
        if not db_user:
            return None

        db_user.update(db, is_deleted=True, email=f'{timestamp()}_{db_user.email}')
        db_user = UserResponse.from_orm(db_user)
        return db_user

        Deletes an user by id.

        Args:
            id (int): The user ID.

        Returns:
            UserResponse: The User Response model.
        
Deletes an user by id.
Deletes an user by id .
def delete(self, db: Session, id: int) -> UserResponse:
        db_user = db.query(User).filter(and_(
            User.id == id,
            User.is_deleted == False
        )).first()
        if not db_user:
            return None
        db_user.update(db, is_deleted=True, email=f'{timestamp()}_{db_user.email}')
        db_user = UserResponse.from_orm(db_user)
        return db_user
def delete ( self , db : Session , id : int ) -> UserResponse : db_user = db . query ( User ) . filter ( and_ ( User . id == id , User . is_deleted == False ) ) . first ( ) if not db_user : return None db_user . update ( db , is_deleted = True , email = f'{timestamp()}_{db_user.email}' ) db_user = UserResponse . from_orm ( db_user ) return db_user
Deletes an user by id.
Deletes an user by id .
"""
        Deletes an user by id.

        Args:
            id (int): The user ID.

        Returns:
            UserResponse: The User Response model.
        """
The User Response model.
The User Response model .
UserResponse
self
db
Session
id
int
The user ID.
The user ID .