'Mark a workflow as deleted'

@web.expose
def delete(self, trans, id=None):

    stored = self.get_stored_workflow(trans, id)
    stored.deleted = True
    trans.user.stored_workflow_menu_entries = [entry for entry in trans.user.stored_workflow_menu_entries if (entry.stored_workflow != stored)]
    trans.sa_session.add(stored)
    trans.sa_session.flush()
    message = ('Workflow    deleted:    %s' % escape(stored.name))
    trans.set_message(message)
    return trans.response.send_redirect((url_for('/') + ('workflow?status=done&message=%s' % escape(message))))
