human
Complete the below
def layer_wms():

    ''''RESTful CRUD controller'
    '''
 ... Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    tablename = ('%s_%s' % (module, resourcename))
    s3db.table(tablename)
    type = 'WMS'
    LAYERS = T((TYPE_LAYERS_FMT % type))
    ADD_NEW_LAYER = T((ADD_NEW_TYPE_LAYER_FMT % type))
    EDIT_LAYER = T((EDIT_TYPE_LAYER_FMT % type))
    LIST_LAYERS = T((LIST_TYPE_LAYERS_FMT % type))
    NO_LAYERS = T((NO_TYPE_LAYERS_FMT % type))
    s3.crud_strings[tablename] = Storage(label_create=ADD_LAYER, title_display=LAYER_DETAILS, title_list=LAYERS, title_update=EDIT_LAYER, label_list_button=LIST_LAYERS, label_delete_button=DELETE_LAYER, msg_record_created=LAYER_ADDED, msg_record_modified=LAYER_UPDATED, msg_record_deleted=LAYER_DELETED, msg_list_empty=NO_LAYERS)
    s3db.set_method(module, resourcename, method='enable', action=enable_layer)
    def prep(r):
        if r.interactive:
            if (r.component_name == 'config'):
                ltable = s3db.gis_layer_config
                if (r.method != 'update'):
                    table = r.table
                    query = ((ltable.layer_id == table.layer_id) & (table.id == r.id))
                    rows = db(query).select(ltable.config_id)
                    ltable.config_id.requires = IS_ONE_OF(db, 'gis_config.id', '%(name)s', not_filterby='config_id', not_filter_opts=[row.config_id for row in rows])
        return True
    s3.prep = prep
    def postp(r, output):
        if (r.interactive and (r.method != 'import')):
            if (not r.component):
                s3_action_buttons(r, copyable=True)
                inject_enable(output)
        return output
    s3.postp = postp
    output = s3_rest_controller(rheader=s3db.gis_rheader)
    return output