Opened 3 years ago

Closed 3 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 3 years ago by bradpitcher

  • Cc bradpitcher@… added
  • Needs documentation set
  • Needs tests unset
  • Owner changed from nobody to bradpitcher
  • Patch needs improvement unset
  • Status changed from new to assigned

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 3 years ago by bradpitcher

  • Has patch set
  • Needs documentation unset
  • Owner changed from bradpitcher to nobody
  • Status changed from assigned to new

comment:3 Changed 3 years ago by spulec

  • Triage Stage changed from Unreviewed to Ready for checkin

Looks good to me, much less ambiguous.

comment:4 Changed 3 years ago by claudep

  • Resolution set to fixed
  • Status changed from new to closed

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

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