mirror of
https://github.com/django/django.git
synced 2025-07-05 10:19:20 +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:
parent
d304ccad8c
commit
5ffaf83ced
@ -183,7 +183,8 @@ class BaseForm(StrAndUnicode):
|
|||||||
# Each widget type knows how to retrieve its own data, because some
|
# Each widget type knows how to retrieve its own data, because some
|
||||||
# widgets split data over several HTML fields.
|
# widgets split data over several HTML fields.
|
||||||
value = field.widget.value_from_datadict(self.data, self.add_prefix(name))
|
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 False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user