diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-06-15 04:48:07 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-06-15 04:48:07 +0000 |
| commit | 5ffaf83ced81aef987772193e5d5c85047dec3a6 (patch) | |
| tree | 44b03fb06675d28b0b84962eba98bbc6ae89a8dc | |
| parent | d304ccad8c24e29b7328019b81e93f792af482d0 (diff) | |
newforms-admin: Fixed Form.is_empty method to allow an empty SplitDateTimeField. A real fix will probably require a new method for fields/widgets.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5476 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/newforms/forms.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py index 902ad616ed..c15d26ece5 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -183,7 +183,8 @@ class BaseForm(StrAndUnicode): # Each widget type knows how to retrieve its own data, because some # widgets split data over several HTML fields. value = field.widget.value_from_datadict(self.data, self.add_prefix(name)) - if value not in (None, ''): + # HACK: ['', ''] and [None, None] deal with SplitDateTimeWidget. This should be more robust. + if value not in (None, '', ['', ''], [None, None]): return False return True |
