Ticket #16038: form-field-patch.patch
File form-field-patch.patch, 1.1 KB (added by , 14 years ago) |
---|
-
django/forms/fields.py
15 15 except ImportError: 16 16 from StringIO import StringIO 17 17 18 from django.conf import settings 18 19 from django.core.exceptions import ValidationError 19 20 from django.core import validators 20 21 from django.utils import formats … … 56 57 57 58 def __init__(self, required=True, widget=None, label=None, initial=None, 58 59 help_text=None, error_messages=None, show_hidden_initial=False, 59 validators=[], localize= False):60 validators=[], localize=None): 60 61 # required -- Boolean that specifies whether the field is required. 61 62 # True by default. 62 63 # widget -- A Widget class, or instance of a Widget class, that should … … 89 90 widget = widget() 90 91 91 92 # Trigger the localization machinery if needed. 92 self.localize = localize 93 if localize is not None: 94 self.localize = localize 95 else: 96 self.localize = getattr(settings, 'USE_L10N', False) 93 97 if self.localize: 94 98 widget.is_localized = True