'Initialize and return the HTML attributes for this widget'

def _attr(self, resource):

    _class = self._class
    attr = self.attr
    if ('_name' not in attr):
        if (not resource):
            raise SyntaxError(('%s:    _name    parameter    required    when    rendered    without    resource.' % self.__class__.__name__))
        flist = self.field
        if (not isinstance(flist, (list, tuple))):
            flist = [flist]
        colnames = []
        for f in flist:
            rfield = S3ResourceField(resource, f)
            colname = rfield.colname
            if colname:
                colnames.append(colname)
            else:
                colnames.append(rfield.fname)
        name = ('%s-%s-%s' % (resource.alias, '-'.join(colnames), _class))
        attr['_name'] = name.replace('.', '_')
    if ('_id' not in attr):
        attr['_id'] = attr['_name']
    return attr
