Opened 14 years ago
Last modified 13 years ago
#16308 closed Uncategorized
CheckboxSelectMultiple can not show the data on the view — at Initial Version
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Forms | Version: | 1.3 |
Severity: | Normal | Keywords: | Checkbox Select Multiple |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
CheckboxSelectMultiple can not show the data on the view.
when the form use CheckboxSelectMultiple, it can not show the data on view.
problem code :
class CheckboxSelectMultiple(SelectMultiple):
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name)
output = [u'<ul>']
# Normalize to strings
str_values = set([force_unicode(v) for v in value])
solustion:
str_values = set([force_unicode(v) for v in eval(value)])