#3406: [patch] newforms: choices checking should unicode choices list before
comparing to a value
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: django.newforms
Version: SVN | Resolution:
Keywords: unicode | Stage: Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 1 | Needs_better_patch: 1
---------------------------------+------------------------------------------
Comment (by [EMAIL PROTECTED]):
Detailed.
line 354: {{{ value = smart_unicode(value) }}}
the value is in unicode after this line
line 357 (original): {{{ valid_values = set([str(k) for k, v in
self.choices]) }}}
here we create the list of available choices.
line 358: if value not in valid_values:
any ideas how this may work if valid_values contains a list of bytestrings
?
And finally, compare my new line 357: {{{ valid_values =
set([smart_unicode(k) for k, v in self.choices]) }}} to original line 383:
{{{ valid_values = set([smart_unicode(k) for k, v in self.choices]) }}} :)
--
Ticket URL: <http://code.djangoproject.com/ticket/3406#comment:3>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---