Ticket #8272: fieldset.diff
File fieldset.diff, 1.8 KB (added by , 16 years ago) |
---|
-
django/forms/fields.py
57 57 creation_counter = 0 58 58 59 59 def __init__(self, required=True, widget=None, label=None, initial=None, 60 help_text=None, error_messages=None ):60 help_text=None, error_messages=None, fieldset=None): 61 61 # required -- Boolean that specifies whether the field is required. 62 62 # True by default. 63 63 # widget -- A Widget class, or instance of a Widget class, that should … … 71 71 # initial -- A value to use in this Field's initial display. This value 72 72 # is *not* used as a fallback if data isn't given. 73 73 # help_text -- An optional string to use as "help text" for this Field. 74 # fieldset -- An optional string to declare a fieldset for this Field for template purposes. 74 75 if label is not None: 75 76 label = smart_unicode(label) 76 77 self.required, self.label, self.initial = required, label, initial … … 102 103 set_class_error_messages(messages, self.__class__) 103 104 messages.update(error_messages or {}) 104 105 self.error_messages = messages 106 107 self.fieldset = fieldset 105 108 106 109 def clean(self, value): 107 110 """ -
django/forms/forms.py
305 305 else: 306 306 self.label = self.field.label 307 307 self.help_text = field.help_text or '' 308 308 self.fieldset = field.fieldset or '' 309 309 310 def __unicode__(self): 310 311 """Renders this field as an HTML widget.""" 311 312 return self.as_widget()