Ticket #3959: label.diff
File label.diff, 2.7 KB (added by , 18 years ago) |
---|
-
fields.py
36 36 # Tracks each time a Field instance is created. Used to retain order. 37 37 creation_counter = 0 38 38 39 def __init__(self, required=True, widget=None, label=None, initial=None, help_text=None): 39 def __init__(self, label=None, required=True, widget=None, initial=None, help_text=None): 40 # label -- A verbose name for this field, for use in displaying this 41 # field in a form. By default, Django will use a "pretty" 42 # version of the form field name, if the Field is part of a 43 # Form. 40 44 # required -- Boolean that specifies whether the field is required. 41 45 # True by default. 42 46 # widget -- A Widget class, or instance of a Widget class, that should 43 47 # be used for this Field when displaying it. Each Field has a 44 48 # default Widget that it'll use if you don't specify this. In 45 49 # most cases, the default widget is TextInput. 46 # label -- A verbose name for this field, for use in displaying this47 # field in a form. By default, Django will use a "pretty"48 # version of the form field name, if the Field is part of a49 # Form.50 50 # initial -- A value to use in this Field's initial display. This value 51 51 # is *not* used as a fallback if data isn't given. 52 52 # help_text -- An optional string to use as "help text" for this Field. … … 332 332 return {True: True, False: False}.get(value, None) 333 333 334 334 class ChoiceField(Field): 335 def __init__(self, choices=(), required=True, widget=Select, label=None, initial=None, help_text=None):336 super(ChoiceField, self).__init__( required, widget, label, initial, help_text)335 def __init__(self, label=None, choices=(), required=True, widget=Select, initial=None, help_text=None): 336 super(ChoiceField, self).__init__(label, required, widget, initial, help_text) 337 337 self.choices = choices 338 338 339 339 def _get_choices(self): … … 365 365 class MultipleChoiceField(ChoiceField): 366 366 hidden_widget = MultipleHiddenInput 367 367 368 def __init__(self, choices=(), required=True, widget=SelectMultiple, label=None, initial=None, help_text=None):369 super(MultipleChoiceField, self).__init__( choices, required, widget, label, initial, help_text)368 def __init__(self, label=None, choices=(), required=True, widget=SelectMultiple, initial=None, help_text=None): 369 super(MultipleChoiceField, self).__init__(label, choices, required, widget, initial, help_text) 370 370 371 371 def clean(self, value): 372 372 """