summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-10-24 07:19:07 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-10-24 07:19:07 +0000
commit73ea785d6b6a26fe16145c962fa5b9f00c428d19 (patch)
treee6d353554794700e91de54ffa29a62818f2ec51a /django/forms
parent6c8561249943cb11ec89cd574f1cbcef9ecb0c8a (diff)
[1.0.X] Fixed #9384 -- Fixed a couple of typos. Thanks, Thomas Güttler and romke.
Backport of r9255 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9259 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/fields.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py
index b20beb939f..2420e2050a 100644
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -667,7 +667,7 @@ class TypedChoiceField(ChoiceField):
self.coerce = kwargs.pop('coerce', lambda val: val)
self.empty_value = kwargs.pop('empty_value', '')
super(TypedChoiceField, self).__init__(*args, **kwargs)
-
+
def clean(self, value):
"""
Validate that the value is in self.choices and can be coerced to the
@@ -676,12 +676,12 @@ class TypedChoiceField(ChoiceField):
value = super(TypedChoiceField, self).clean(value)
if value == self.empty_value or value in EMPTY_VALUES:
return self.empty_value
-
+
# Hack alert: This field is purpose-made to use with Field.to_python as
# a coercion function so that ModelForms with choices work. However,
- # Django's Field.to_python raises django.core.exceptions.ValidationError,
- # which is a *different* exception than
- # django.forms.utils.ValidationError. So unfortunatly we need to catch
+ # Django's Field.to_python raises
+ # django.core.exceptions.ValidationError, which is a *different*
+ # exception than django.forms.util.ValidationError. So we need to catch
# both.
try:
value = self.coerce(value)