'Render the filter widgets
@param resource: the S3Resource
@param get_vars: the request GET vars (URL query dict)
@param alias: the resource alias to use in widgets
@param formstyle: the formstyle to use
@return: a list of form rows'

def _render_widgets(self, resource, get_vars=None, alias=None, formstyle=None):

    rows = []
    rappend = rows.append
    advanced = False
    for f in self.widgets:
        widget = f(resource, get_vars, alias=alias)
        widget_opts = f.opts
        label = widget_opts['label']
        comment = widget_opts['comment']
        hidden = widget_opts['hidden']
        widget_formstyle = widget_opts.get('formstyle', formstyle)
        if hidden:
            advanced = True
        widget_id = f.attr['_id']
        if widget_id:
            row_id = ('%s__row' % widget_id)
            label_id = ('%s__label' % widget_id)
        else:
            row_id = None
            label_id = None
        if label:
            label = LABEL(('%s:' % label), _id=label_id, _for=widget_id)
        else:
            label = ''
        if (not comment):
            comment = ''
        formrow = widget_formstyle(row_id, label, widget, comment, hidden=hidden)
        if hidden:
            if isinstance(formrow, DIV):
                formrow.add_class('advanced')
            elif isinstance(formrow, tuple):
                for item in formrow:
                    if hasattr(item, 'add_class'):
                        item.add_class('advanced')
        rappend(formrow)
    if advanced:
        if resource:
            self.opts['advanced'] = resource.get_config('filter_advanced', True)
        else:
            self.opts['advanced'] = True
    return rows
