def delete_user_in_group(self, user_id, group_uuid): ''' Add user as a member of a group. ''' with self.engine.begin() as connection: connection.execute(cl_user_group.delete().\ where(cl_user_group.c.user_id == user_id).\ where(cl_user_group.c.group_uuid == group_uuid) )
def delete_group(self, uuid): ''' Delete the group with the given uuid. ''' with self.engine.begin() as connection: connection.execute(cl_group_object_permission.delete().\ where(cl_group_object_permission.c.group_uuid == uuid) ) connection.execute(cl_user_group.delete().\ where(cl_user_group.c.group_uuid == uuid) ) connection.execute(cl_group.delete().where( cl_group.c.uuid == uuid ))