Opened 9 years ago

Closed 9 years ago

Last modified 7 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


I and some collegues always refer to 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 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by Russell Keith-Magee

milestone: 1.2
Triage Stage: UnreviewedAccepted

Changed 9 years ago by Preston Holmes

Attachment: 12833.diff added

comment:2 Changed 9 years ago by Preston Holmes

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 Changed 9 years ago by Russell Keith-Magee

Triage Stage: AcceptedReady for checkin

comment:4 Changed 9 years ago by Russell Keith-Magee

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 Changed 7 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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