From 5ffaf83ced81aef987772193e5d5c85047dec3a6 Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Fri, 15 Jun 2007 04:48:07 +0000 Subject: [PATCH] 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 --- django/newforms/forms.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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