diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-05-12 02:36:05 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-05-12 02:36:05 +0000 |
| commit | 415e84ad53e0d0d8f7df87784c1893489bdbe0b8 (patch) | |
| tree | 09541f8319c45ec51fb44154534abc41cb86aee9 /django/core/validators.py | |
| parent | 4938c8ea6db6f23ebb0883b8a092985344508b25 (diff) | |
newforms-admin: Merged to [5194]
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@5195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/validators.py')
| -rw-r--r-- | django/core/validators.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index bd7d790e04..26165c4af1 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -284,7 +284,7 @@ class ValidateIfOtherFieldEquals(object): self.always_test = True def __call__(self, field_data, all_data): - if all_data.has_key(self.other_field) and all_data[self.other_field] == self.other_value: + if self.other_field in all_data and all_data[self.other_field] == self.other_value: for v in self.validator_list: v(field_data, all_data) @@ -322,7 +322,7 @@ class RequiredIfOtherFieldEquals(object): self.always_test = True 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: + if self.other_field in all_data and all_data[self.other_field] == self.other_value and not field_data: raise ValidationError(self.error_message) class RequiredIfOtherFieldDoesNotEqual(object): @@ -335,7 +335,7 @@ class RequiredIfOtherFieldDoesNotEqual(object): self.always_test = True 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: + if self.other_field in all_data and all_data[self.other_field] != self.other_value and not field_data: raise ValidationError(self.error_message) class IsLessThanOtherField(object): |
