diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2011-01-13 16:41:46 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2011-01-13 16:41:46 +0000 |
| commit | 1222bd6f6f7f74a5b885f8a69242011ba3bc5a93 (patch) | |
| tree | 77181d39f0a4ee05c7058f6b576e86c67ba8c8f3 /django/forms | |
| parent | 8781ea6cd71de32fc9cc30c3427c682b9448fd50 (diff) | |
Fixed #13631 -- Made sure that max_length and min_length are retained as attributes on form fields. Thanks to mila for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/fields.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index d0a93cf0a6..4d7728f58c 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -224,6 +224,7 @@ class IntegerField(Field): } def __init__(self, max_value=None, min_value=None, *args, **kwargs): + self.max_value, self.min_value = max_value, min_value super(IntegerField, self).__init__(*args, **kwargs) if max_value is not None: @@ -279,6 +280,7 @@ class DecimalField(Field): } def __init__(self, max_value=None, min_value=None, max_digits=None, decimal_places=None, *args, **kwargs): + self.max_value, self.min_value = max_value, min_value self.max_digits, self.decimal_places = max_digits, decimal_places Field.__init__(self, *args, **kwargs) @@ -587,7 +589,7 @@ class URLField(CharField): url_fields[0] = 'http' if not url_fields[1]: # Assume that if no domain is provided, that the path segment - # contains the domain. + # contains the domain. url_fields[1] = url_fields[2] url_fields[2] = '' # Rebuild the url_fields list, since the domain segment may now |
