Opened 18 years ago
Closed 17 years ago
#2815 closed defect (invalid)
problem with custom validator and boolean fields
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Validators | Version: | 0.95 |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have model with a boolean field, and a custom validator is defined in the validator_list parameter.
he validator has to run
whenever the form is submitted, whether the checkbox is ticked or not.
I have set the 'always_test' parameter to true for the validator, but
the validator still only gets called when the box is ticked. I have
found that the 'always_test' parameter works fine for other types of
field, it just appears to be a problem with booleanfields. Relevant
sections of the model are pasted below:
class Order(models.Model):
def stor_all(field_data, new_data):
..validator code goes here
stor_all.always_test = True
storage_all = models.BooleanField('All to be delivered to
storage?', null='true', validator_list = [stor_all])
Change History (3)
comment:1 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 17 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I don't think we should close tickets just because they haven't been confirmed. We could end up closing a bunch of valid tickets that way.
comment:3 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
The submitter emailed me and confirmed that this had been a mistake on his part, and not a bug in Django.
Can you confirm if this is still a problem on a current checkout?