diff options
| -rw-r--r-- | django/newforms/widgets.py | 2 | ||||
| -rw-r--r-- | tests/regressiontests/forms/widgets.py | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/django/newforms/widgets.py b/django/newforms/widgets.py index 8965a8c108..df5c20d97d 100644 --- a/django/newforms/widgets.py +++ b/django/newforms/widgets.py @@ -571,6 +571,8 @@ class MultiWidget(Widget): def _has_changed(self, initial, data): if initial is None: initial = [u'' for x in range(0, len(data))] + else: + initial = self.decompress(initial) for widget, initial, data in zip(self.widgets, initial, data): if not widget._has_changed(initial, data): return False diff --git a/tests/regressiontests/forms/widgets.py b/tests/regressiontests/forms/widgets.py index 0e69602103..d701879311 100644 --- a/tests/regressiontests/forms/widgets.py +++ b/tests/regressiontests/forms/widgets.py @@ -895,6 +895,12 @@ u'<input id="foo_0" type="text" class="big" value="john" name="name_0" /><br />< >>> w.render('name', ['john', 'lennon']) u'<input id="bar_0" type="text" class="big" value="john" name="name_0" /><br /><input id="bar_1" type="text" class="small" value="lennon" name="name_1" />' +>>> w = MyMultiWidget(widgets=(TextInput(), TextInput())) +>>> w._has_changed(None, ['john', 'lennon']) +True +>>> w._has_changed('john__lennon', ['john', 'lennon']) +False + # SplitDateTimeWidget ######################################################### >>> w = SplitDateTimeWidget() |
