Django

Code

Changeset 5476

Show
Ignore:
Timestamp:
06/14/07 23:48:07 (1 year ago)
Author:
jkocherhans
Message:

newforms-admin: Fixed Form.is_empty method to allow an empty SplitDateTimeField?. A real fix will probably require a new method for fields/widgets.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/newforms/forms.py

    r5440 r5476  
    184184            # widgets split data over several HTML fields. 
    185185            value = field.widget.value_from_datadict(self.data, self.add_prefix(name)) 
    186             if value not in (None, ''): 
     186            # HACK: ['', ''] and [None, None] deal with SplitDateTimeWidget. This should be more robust. 
     187            if value not in (None, '', ['', ''], [None, None]): 
    187188                return False 
    188189        return True