250 | | return mark_safe(u'\n'.join([(u'<input%s />' % |
251 | | flatatt(dict(value=force_unicode(v), **final_attrs))) |
252 | | for v in value])) |
| 250 | id_attr = final_attrs.get('id') |
| 251 | inputs = [] |
| 252 | for i, v in enumerate(value): |
| 253 | input_attrs = dict(value=force_unicode(v), **final_attrs) |
| 254 | if id_attr: |
| 255 | # An ID attribute was given. Add a numeric index as a suffix |
| 256 | # so that the inputs don't all have the same ID attribute. |
| 257 | input_attrs['id'] = '%s_%s' % (id_attr, i) |
| 258 | inputs.append(u'<input%s />' % flatatt(input_attrs)) |
| 259 | return mark_safe(u'\n'.join(inputs)) |