def event():

    # Pre-process
    def prep(r):
        if r.interactive:
            if r.component:
                if r.component.name == "req":
                    if r.method != "update" and r.method != "read":
                        # Hide fields which don't make sense in a Create form
                        # inc list_create (list_fields over-rides)
                        s3db.req_create_form_mods()

            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.exercise.writable = False
                table.exercise.comment = None
                table.start_date.writable = False

        return True
    s3.prep = prep

    return s3_rest_controller(rheader = s3db.event_rheader)

# -----------------------------------------------------------------------------
<channel>
dataset/ETHPy150Open sahana/eden/controllers/event.py/event--crossover with--dataset/ETHPy150Open ProgVal/Limnoria/plugins/Relay/plugin.py/Relay.part