Opened 12 years ago

Closed 12 years ago

#18917 closed Cleanup/optimization (fixed)

confusing documentation for clean_<fieldname>()

Reported by: Sergiy Kuzmenko 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 by Brad Pitcher, 12 years ago

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 by Brad Pitcher, 12 years ago

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

comment:3 by Steve Pulec, 12 years ago

Triage Stage: UnreviewedReady for checkin

Looks good to me, much less ambiguous.

comment:4 by Claude Paroz, 12 years ago

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