Ticket #5851: widgets_2.diff

File widgets_2.diff, 727 bytes (added by ciantic@…, 8 years ago)

Second approach to the problem

  • django/newforms/widgets.py

     
    442442    """
    443443    A Widget that splits datetime input into two <input type="text"> boxes.
    444444    """
    445     def __init__(self, attrs=None):
    446         widgets = (TextInput(attrs=attrs), TextInput(attrs=attrs))
    447         super(SplitDateTimeWidget, self).__init__(widgets, attrs)
     445    def __init__(self, attrs=(None, None)):
     446        widgets = (TextInput(attrs=attrs[0]), TextInput(attrs=attrs[1]))
     447        super(SplitDateTimeWidget, self).__init__(widgets, None)
    448448
    449449    def decompress(self, value):
    450450        if value:
Back to Top