Opened 4 years ago

Closed 4 years ago

#18917 closed Cleanup/optimization (fixed)

confusing documentation for clean_<fieldname>()

Reported by: shelldweller Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords: forms, validation, documentation
Cc: bradpitcher@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

On https://docs.djangoproject.com/en/1.4/ref/forms/validation/ under the clean_<fieldname>() section it says:

Just like the general field clean() method, above, this method should return the cleaned data, regardless of whether it changed anything or not.

However the in the context of clean() cleaned data refers to the dictionary and in the context of clean_<fieldname>() it refers to a single cleaned value. So how about we change that phrase to this:

This method should return the cleaned value obtained from cleaned_data, regardless of whether it changed anything or not.

Change History (4)

comment:1 Changed 4 years ago by Brad Pitcher

Cc: bradpitcher@… added
Needs documentation: set
Owner: changed from nobody to Brad Pitcher
Status: newassigned

I agree, the docs for both methods talk about returning "cleaned data", but it's different data from each method. Your suggestion clears up the ambiguity.

comment:2 Changed 4 years ago by Brad Pitcher

Has patch: set
Needs documentation: unset
Owner: changed from Brad Pitcher to nobody
Status: assignednew

comment:3 Changed 4 years ago by Steve Pulec

Triage Stage: UnreviewedReady for checkin

Looks good to me, much less ambiguous.

comment:4 Changed 4 years ago by Claude Paroz

Resolution: fixed
Status: newclosed

Pull request merged, but closing the ticket has been forgotten.

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