def programme():

    mode = session.s3.hrm.mode

    if not auth.s3_has_role(ADMIN):
        s3.filter = auth.filter_by_root_org(s3db.hrm_programme)

    def prep(r):
        if mode is not None:
            auth.permission.fail()
        if r.component_name == "person":
            s3db.configure("hrm_programme_hours",
                           list_fields = ["person_id",
                                          "training",
                                          "programme_id",
                                          "date",
                                          "hours",
                                          ])
        return True
    s3.prep = prep

    return s3_rest_controller("hrm", resourcename,
                              rheader=s3db.hrm_rheader,
                              csv_stylesheet = ("hrm", "programme.xsl"),
                              csv_template = ("hrm", "programme")
                              )

# -----------------------------------------------------------------------------
Volunteer Programmes controller
dataset/ETHPy150Open sahana/eden/controllers/vol.py/programme