Skip to content

Commit

Permalink
Fixed small Unicode error in newforms. Thanks, Honza Král. Refs #3114
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Dec 8, 2006
1 parent 5f36d9d commit 4e72dc8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion django/newforms/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def clean(self, value):
val = smart_unicode(val)
new_value.append(val)
# Validate that each value in the value list is in self.choices.
valid_values = set([k for k, v in self.choices])
valid_values = set([smart_unicode(k) for k, v in self.choices])
for val in new_value:
if val not in valid_values:
raise ValidationError(gettext(u'Select a valid choice. %s is not one of the available choices.') % val)
Expand Down
8 changes: 8 additions & 0 deletions docs/newforms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ The library deals with these concepts:
* **Form** -- A collection of fields that knows how to validate itself and
display itself as HTML.



Using forms with templates
==========================

Using forms in views
====================

More coming soon
================

Expand Down

0 comments on commit 4e72dc8

Please sign in to comment.