Opened 18 years ago
Closed 18 years ago
#3250 closed enhancement (wontfix)
[patch] Add RequiredIfOtherFieldsNotGiven, RequiredIfAllOtherFieldsNotGiven, and AllValidators
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Validators | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the Validators documentation there claims to be a RequiredIfOtherFieldsNotGiven, but it doesn't actually exist. This implements the documented semantics and also introduces two supporting validators.
RequiredIfAllOtherFieldsNotGiven: Like the one mentioned above, but fails only when all of the other fields are not given (instead of any).
AllValidators: Like AnyValidator, but passes only when all of the given validators pass.
Attachments (2)
Change History (7)
by , 18 years ago
Attachment: | brian_validators.diff added |
---|
comment:1 by , 18 years ago
The patch attached here overlaps with the patch on ticket #2266.
The patch on ticket #2266 adds RequiredIfOtherFieldsNotGiven (with tests and updated docs) while this ticket offers RequiredIfOtherFieldsNotGiven and a new RequiredIfAllOtherFieldsNotGiven validators with tests but no docs.
Should we merge the tickets and flag one as a duplicate?
follow-up: 3 comment:2 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
My thoughts:
- take the RequiredIfOtherFieldsNotGiven from #2266
- take the RequiredIfOtherFieldsNotGiven and RequiredIfAllOtherFieldsNotGiven from here.
comment:3 by , 18 years ago
Replying to Simon G. <dev@simon.net.nz>:
My thoughts:
- take the RequiredIfOtherFieldsNotGiven from #2266
- take the RequiredIfOtherFieldsNotGiven and RequiredIfAllOtherFieldsNotGiven from here.
Did you mean "take AllValidators and RequiredIfAllOtherFieldsNotGiven from here"?
In any case, I'd love to see these patches released soon.
Thanks!
comment:4 by , 18 years ago
Hmm.
Might be tough to justify adding more functionality to the manipulator system just as we're deprecating it...
comment:5 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Since the validator functions primarily exist to support the oldforms part of the framework, we aren't adding any extra functionality to it now. It's deprecated. The fact that validators can also be used in model fields is kind of a side-effect and some model-aware validation changes will slowly phase that out, too.
adds validators mentioned in #3250