I tried using django.core.validators.RequiredIfOtherFieldDoesNotEqual
to validate against a checkbox, and I think I ran into a bug.
Browsers often don't include checkboxes in POST data, and it seems
that RequiredIfOtherFieldDoesNotEqual assumes that they are:
def __call__(self, field_data, all_data):
if all_data.has_key(self.other_field) and \
all_data[self.other_field] != self.other_value and \
not field_data:
raise ValidationError(self.error_message)
My use case is to make a field required only if a checkbox is
unchecked. If this is a bug, what can I do to help?
Thanks!
Beau
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---