Opened 18 years ago

Closed 18 years ago

#2266 closed enhancement (fixed)

[patch] Form validator django.core.validators.RequiredIfOtherFieldsNotGiven does not exist

Reported by: matt.riggott@… Owned by: Adrian Holovaty
Component: Core (Other) Version: dev
Severity: normal Keywords: form manipulator validator
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

Although the validator class RequiredIfOtherFieldsNotGiven is mentioned in the Form-fields and manipulators documentation, is doesn't actually exist in django.core.validators. The attached patch adds this class.

Attachments (3)

RequiredIfOtherFieldsNotGiven.diff (1.1 KB ) - added by matt.riggott@… 18 years ago.
Patch to add RequiredIfOtherFieldsNotGiven to django.core.validators
given_validators.diff (3.3 KB ) - added by alang@… 18 years ago.
Updated patches
validators.py (3.1 KB ) - added by alang@… 18 years ago.
tests/othertests/validators.py

Download all attachments as: .zip

Change History (9)

by matt.riggott@…, 18 years ago

Patch to add RequiredIfOtherFieldsNotGiven to django.core.validators

comment:1 by anonymous, 18 years ago

Summary: Form validator django.core.validators.RequiredIfOtherFieldsNotGiven does not exist[patch] Form validator django.core.validators.RequiredIfOtherFieldsNotGiven does not exist

by alang@…, 18 years ago

Attachment: given_validators.diff added

Updated patches

comment:2 by alang@…, 18 years ago

Attached updated patches against changeset 3445 (25-July-06)

Fixed:

RequiredIfOtherFieldsNotGiven - was documented but not implemented.
RequiredIfOtherFieldsGiven - was implemented but not documented.
RequiredIfOtherFieldGiven - was implemented but not documented.

Broke the compound conditions in the validators into separate if statements, because trying to figure out what anded nots in a loop were supposed to do was making my brain hurt.

Provided some doctests for these validators. (uploaded separately)

Finally, the documented behaviour of RequiredIfOtherFieldsNotGiven was a little odd. Whereas the validator used to require a value if any of the other fields was not given, it now requires a value only when none of the other fields is given. Since the validator was not implemented previously, this is not a breaking change.

by alang@…, 18 years ago

Attachment: validators.py added

tests/othertests/validators.py

comment:3 by Rudolph Froger, 18 years ago

The Django docs don't mention the current RequiredIfOtherFieldGiven and RequiredIfOtherFieldsGiven validators.

comment:4 by Simon G. <dev@…>, 18 years ago

Triage Stage: UnreviewedReady for checkin

see also #3250

comment:5 by Malcolm Tredinnick, 18 years ago

(In [5113]) Fixed up some omissions and one mysteriously documented, yet non-existent field
in the validator documentation. Patch from alang@…. Refs #2266.

comment:6 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

The validator framework is deprecated functionality at this point, so we aren't adding any more features to it. What I've done is removed the documentation for the non-existed RequiredIfOtherFieldsNotGiven and merged in alang's documentation for RequiredIfOtherField[s]Given.

Note: See TracTickets for help on using tickets.
Back to Top