From 4e72dc86ff30b2e551b0891ac6dbf23f032a4bf8 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 8 Dec 2006 05:54:14 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20small=20Unicode=20error=20in=20newforms?= =?UTF-8?q?.=20Thanks,=20Honza=20Kr=C3=A1l.=20Refs=20#3114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://code.djangoproject.com/svn/django/trunk@4185 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/newforms/fields.py | 2 +- docs/newforms.txt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/django/newforms/fields.py b/django/newforms/fields.py index d676a1c58b..fada75fe5d 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -277,7 +277,7 @@ class MultipleChoiceField(ChoiceField): 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) diff --git a/docs/newforms.txt b/docs/newforms.txt index f796477a9e..9bfbc75ee7 100644 --- a/docs/newforms.txt +++ b/docs/newforms.txt @@ -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 ================