@auth.s3_requires_membership(1)
def sms_modem_channel():
    """
        RESTful CRUD controller for modem channels
        - appears in the administration menu
        Multiple Modems can be configured to receive Inbound Messages
    """

    try:
        import serial
    except __HOLE__:
        session.error = T("Python Serial module not available within the running Python - this needs installing to activate the Modem")
        redirect(URL(c="admin", f="index"))

    tablename = "%s_%s" % (module, resourcename)
    table = s3db[tablename]

    table.modem_port.label = T("Port")
    table.modem_baud.label = T("Baud")
    table.enabled.label = T("Enabled")
    table.modem_port.comment = DIV(_class="tooltip",
                                   _title="%s|%s" % (T("Port"),
                                                     T("The serial port at which the modem is connected - /dev/ttyUSB0, etc on linux and com1, com2, etc on Windows")))
    table.modem_baud.comment = DIV(_class="tooltip",
                                   _title="%s|%s" % (T("Baud"),
                                                     T("Baud rate to use for your modem - The default is safe for most cases")))
    table.enabled.comment = DIV(_class="tooltip",
                                _title="%s|%s" % (T("Enabled"),
                                                  T("Unselect to disable the modem")))

    # CRUD Strings
    s3.crud_strings[tablename] = Storage(
        label_create = T("Add Modem Channel"),
        title_display = T("Modem Channel Details"),
        title_list = T("Modem Channels"),
        title_update = T("Edit Modem Channel"),
        label_list_button = T("View Modem Channels"),
        msg_record_created = T("Modem Channel added"),
        msg_record_modified = T("Modem Channel updated"),
        msg_record_deleted = T("Modem Channel deleted"),
        msg_list_empty = T("No Modem Channels currently defined"))

    return s3_rest_controller()

#------------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/controllers/msg.py/sms_modem_channel