Django

Code

Ticket #2266 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: matt.riggott@gmail.com Assigned to: adrian
Milestone: Component: Core framework
Version: SVN Keywords: form manipulator validator
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

RequiredIfOtherFieldsNotGiven.diff (1.1 kB) - added by matt.riggott@gmail.com on 06/29/06 11:00:30.
Patch to add RequiredIfOtherFieldsNotGiven? to django.core.validators
given_validators.diff (3.3 kB) - added by alang@bright-green.com on 07/25/06 07:45:51.
Updated patches
validators.py (3.1 kB) - added by alang@bright-green.com on 07/25/06 07:54:02.
tests/othertests/validators.py

Change History

06/29/06 11:00:30 changed by matt.riggott@gmail.com

  • attachment RequiredIfOtherFieldsNotGiven.diff added.

Patch to add RequiredIfOtherFieldsNotGiven? to django.core.validators

07/04/06 08:39:10 changed by anonymous

  • summary changed from Form validator django.core.validators.RequiredIfOtherFieldsNotGiven does not exist to [patch] Form validator django.core.validators.RequiredIfOtherFieldsNotGiven does not exist.

07/25/06 07:45:51 changed by alang@bright-green.com

  • attachment given_validators.diff added.

Updated patches

07/25/06 07:52:19 changed by alang@bright-green.com

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.

07/25/06 07:54:02 changed by alang@bright-green.com

  • attachment validators.py added.

tests/othertests/validators.py

08/11/06 15:22:14 changed by Rudolph

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

01/25/07 03:42:19 changed by Simon G. <dev@simon.net.nz>

  • stage changed from Unreviewed to Ready for checkin.

see also #3250

04/27/07 10:06:46 changed by mtredinnick

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

04/27/07 10:08:22 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

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.


Add/Change #2266 ([patch] Form validator django.core.validators.RequiredIfOtherFieldsNotGiven does not exist)




Change Properties
Action