Changeset 8028 for libcommonDjango
- Timestamp:
- 11/19/08 17:25:42 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libcommonDjango/django/pimentech/validationforms.py
r8027 r8028 11 11 from sets import Set 12 12 from django.utils.translation import gettext_lazy 13 from itertools import chain 13 14 14 15 … … 49 50 output = [u'<select multiple="multiple"%s>' % forms.flatatt(final_attrs)] 50 51 str_values = set([smart_unicode(v) for v in value]) # Normalize to strings. 51 for option_value, option_label in forms.chain(self.choices, choices):52 for option_value, option_label in chain(self.choices, choices): 52 53 option_value = smart_unicode(option_value) 53 54 selected_html = (option_value in str_values) and ' selected="selected"' or '' … … 64 65 output = [u'<ul>'] 65 66 str_values = set([smart_unicode(v) for v in value]) # Normalize to strings. 66 for i, (option_value, option_label) in enumerate( forms.chain(self.choices, choices)):67 for i, (option_value, option_label) in enumerate(chain(self.choices, choices)): 67 68 # If an ID attribute was given, add a numeric index as a suffix, 68 69 # so that the checkboxes don't all have the same ID attribute.
