'Construct an OptionsWidget for rows or cols axis
@param axis: "rows" or "cols"
@param options: the report options
@param get_vars: the GET vars if the request (as dict)
@param widget_id: the HTML element ID for the widget'

def axis_options(self, axis, options=None, get_vars=None, widget_id=None):

    resource = self.resource
    prefix = resource.prefix_selector
    if (options and (axis in options)):
        fields = options[axis]
    else:
        fields = resource.get_config('list_fields')
    if (not fields):
        fields = [f.name for f in resource.readable_fields()]
    pkey = str(resource._id)
    resolve_selector = resource.resolve_selector
    rfields = []
    append = rfields.append
    for f in fields:
        if isinstance(f, (tuple, list)):
            (label, selector) = f[:2]
        else:
            (label, selector) = (None, f)
        rfield = resolve_selector(selector)
        if (rfield.colname == pkey):
            continue
        if label:
            rfield.label = label
        append(rfield)
    if (get_vars and (axis in get_vars)):
        value = get_vars[axis]
    else:
        value = ''
    if value:
        value = prefix(value)
    opts = [(prefix(rfield.selector), rfield.label) for rfield in rfields]
    dummy_field = Storage(name=axis, requires=IS_IN_SET(opts))
    return OptionsWidget.widget(dummy_field, value, _id=widget_id, _name=axis, _class=('pt-%s' % axis))
