Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12643 closed (fixed)

Should mention to call parent clean method for modelForm in custom validation chapter

Reported by: fgaudin Owned by: Preston Holmes
Component: Documentation Version: 1.1
Severity: Keywords: ModelForm, validation, clean
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

I and some collegues always refer to http://docs.djangoproject.com/en/1.1/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other to check how to do custom validation, I've been looking for a while before finding that I need to call the parent clean method for modelForm (to avoid postgres to raise the unique constraint error).

I found later that it was written in ModelForm documentation. Just a warning with a link to this chapter would be great.

Attachments (1)

12833.diff (840 bytes ) - added by Preston Holmes 15 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Russell Keith-Magee, 15 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

by Preston Holmes, 15 years ago

Attachment: 12833.diff added

comment:2 by Preston Holmes, 15 years ago

Has patch: set
Owner: changed from nobody to Preston Holmes

I inserted the note and link where it seemed most appropriate in the introduction to the clean method - I couldn't figure out if there is a way to link to a #section, and couldn't find any example of such a ref after a quick look around the docs.

comment:3 by Russell Keith-Magee, 15 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Russell Keith-Magee, 15 years ago

Resolution: fixed
Status: newclosed

(In [13163]) Fixed #12643 -- Added link to the ModelForm documentation clarifying the special requirements of a clean() method on a modelform. Thanks to fgaudin for the report, and ptone for the patch.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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