Code

Opened 7 years ago

Closed 7 years ago

#4386 closed (duplicate)

docs/newforms.txt: Explain custom cleaning/validation

Reported by: Thomas Güttler <hv@…> Owned by: jacob
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Hi,

here is a patch to document he custom cleaning method clean_FIELDNAME()

Attachments (1)

newforms-cleanmethod.diff (1009 bytes) - added by Thomas Güttler <hv@…> 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Thomas Güttler <hv@…>

comment:1 Changed 7 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

By the time clean_first_name gets called, you can access the value in cleaned_data:

value = self.cleaned_data['first_name']

but this could change slightly if #4391 gets fixed.

comment:2 Changed 7 years ago by mtredinnick

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

Thanks, Thomas. I'll combine an example like yours with #4473 (which discusses the whole cleaning process) when I apply that.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.