def incident():

    # Pre-process
    def prep(r):
        if r.interactive or r.representation == "aadata":
            if r.component:
                if r.component.alias == "assign":
                    if not r.method:
                        r.method = "assign"
                    if r.method == "assign":
                        r.custom_action = s3db.hrm_AssignMethod(component="assign")
                if r.component_name == "config":
                    s3db.configure("gis_config",
                                   deletable = False,
                                   )
                    s3.crud.submit_button = T("Update")
                elif r.component_name in ("asset", "human_resource", "organisation", "site"):
                    s3.crud.submit_button = T("Assign")
                    s3.crud_labels["DELETE"] = T("Remove")
                #else:
                #    s3.crud.submit_button = T("Assign")
                #    s3.crud_labels["DELETE"] = T("Remove")

            elif r.method != "update" and r.method != "read":
                # Create or ListCreate
                r.table.closed.writable = r.table.closed.readable = False

            elif r.method == "update":
                # Can't change details after event activation
                table = r.table
                table.scenario_id.writable = False
                table.exercise.writable = False
                table.exercise.comment = None
                table.zero_hour.writable = False

        return True
    s3.prep = prep

    # Post-process
    def postp(r, output):

        if r.interactive:
            if r.component:
                if r.component.name == "human_resource":
                    #update_url = URL(c="hrm", f="human_resource", args=["[id]"])
                    #s3_action_buttons(r, update_url=update_url)
                    s3_action_buttons(r)
                    if "msg" in settings.modules:
                        s3base.S3CRUD.action_button(url = URL(f="compose",
                                                              vars = {"hrm_id": "[id]"}),
                                                    _class = "action-btn send",
                                                    label = str(T("Send Notification")))
        return output
    s3.postp = postp

    output = s3_rest_controller(rheader = s3db.event_rheader)
    return output

# -----------------------------------------------------------------------------
Test the outputter, pass in data to return
dataset/ETHPy150Open sahana/eden/controllers/event.py/incident--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/test.py/outputter