> (now strongly in "thread should be on django-devel" territory)
>
> I changed validate_full() to this:
> if not self.blank and (field_data is None or field_data == ''):
> return [_('This field is required.')]
>
> and IntegerField was now properly validated. However IntegerFields now error
> when they are set to '0' instead of 0, so perhaps a to_python() method
> similar to AutoFields should be added to IntegerField.
>
> Also, this change breaks the regression tests for the serializers. Seems
> there is a data item where an IntegerData is set to None. Why use None and
> not 0?
Did not mean to send it so quicktly )-:
My tests also had a to_python method on IntegerField. Without this method the 0
case works but it also validates any IntegerField as long as it has SOME value.
For instance "field = 'one'" works. Looks like either a to_python or a validate
method is called for. I think to_python() is the right thing, but perhaps
someone with more experience would like to comment.
Ignore my yammering about '0' versus 0, that was me not understanding the
output of the test harness. Had two tests side by side and I misjudged which
one failed.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---