1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

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
This commit is contained in:
Joseph Kocherhans 2007-06-15 04:48:07 +00:00
parent d304ccad8c
commit 5ffaf83ced

View File

@ -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