Ticket #12048: widgets.py.patch

File widgets.py.patch, 598 bytes (added by powderflask <powderflask@…>, 6 years ago)

patch for MultiWidget deepcopy bug (django.forms.MultiWidget)

  • django/forms/widgets.py

     
    700700        return media
    701701    media = property(_get_media)
    702702
     703    def __deepcopy__(self, memo):
     704        obj = copy.deepcopy(super(MultiWidget, self), memo)
     705        memo[id(self)] = obj
     706        obj.widgets = copy.deepcopy(self.widgets, memo)
     707        return obj
     708
    703709class SplitDateTimeWidget(MultiWidget):
    704710    """
    705711    A Widget that splits datetime input into two <input type="text"> boxes.
Back to Top