Code

Opened 3 years ago

Closed 3 years ago

#16453 closed Bug (fixed)

FormWizard: Incorrect method signature

Reported by: anonymous Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation at https://docs.djangoproject.com/en/1.3/ref/contrib/formtools/form-wizard/#creating-a-formwizard-class states that the method signature for done() is as follows:
def done(self, request, form_list):

Using this example results in the following error:
done() takes exactly 3 arguments (2 given)

The correct signature is as follows (without the request argument):
def done(self, form_list):

Attachments (0)

Change History (1)

comment:1 Changed 3 years ago by BernhardEssl

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

If you using django trunk you should look at the development docs (replace "1.3" with "dev") https://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-wizard/#creating-a-wizardview-class.

However, the example in the dev docs should work:

def done(self, form_list, **kwargs):

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.