

def render(self, name, value, attrs=None, choices=(), *args, **kwargs):
    if (value is None):
        value = ''
    final_attrs = self.build_attrs(attrs, name=name)
    css_class = final_attrs.get('class', 'list')
    output = ('<ul class="%s">' % name)
    options = None
    if value:
        if getattr(value, '__iter__', None):
            options = [(index, string) for (index, string) in self.choices if (index in value)]
        else:
            options = [(index, string) for (index, string) in self.choices if (index == value)]
    elif self.choices:
        if ((self.choices[0] != ('', '---------')) and (value != [])):
            options = [(index, string) for (index, string) in self.choices]
    if options:
        for (index, string) in options:
            if self.queryset:
                try:
                    output += ('<li><a href="%s">%s</a></li>' % (self.queryset.get(pk=index).get_absolute_url(), string))
                except AttributeError:
                    output += ('<li>%s</li>' % string)
            else:
                output += ('<li>%s</li>' % string)
    else:
        output += ('<li>%s</li>' % _('None'))
    return mark_safe((output + '</ul>\n'))

dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/common/widgets.py DetailSelectMultiple.render/VarMisuse@72/91 `css_class`->`name`