Ticket #3515: fields.diff
File fields.diff, 905 bytes (added by , 18 years ago) |
---|
-
fields.py
35 35 # Tracks each time a Field instance is created. Used to retain order. 36 36 creation_counter = 0 37 37 38 def __init__(self, required=True, widget=None, label=None, initial=None, help_text=None ):38 def __init__(self, required=True, widget=None, label=None, initial=None, help_text=None, css=None): 39 39 # required -- Boolean that specifies whether the field is required. 40 40 # True by default. 41 41 # widget -- A Widget class, or instance of a Widget class, that should be … … 60 60 extra_attrs = self.widget_attrs(widget) 61 61 if extra_attrs: 62 62 widget.attrs.update(extra_attrs) 63 64 # Allow a CSS class to be specified 65 if css: 66 widget.attrs.update({'class':css}) 63 67 64 68 self.widget = widget