def flush(obj): sa_session.add(obj) sa_session.flush()
def mark_obj_deleted(obj): obj.deleted = True sa_session.add(obj) sa_session.flush()
def delete_user_roles(user): for ura in user.roles: sa_session.delete(ura) sa_session.flush()
def delete_obj(obj): sa_session.delete(obj) sa_session.flush()