[1.5.X] Fixed #19880 - Fixed an error in the form wizard initial_dict example.

Thanks almalki for the report.

Backport of 9b97f01dea from master
This commit is contained in:
Tim Graham 2013-02-23 15:26:41 -05:00
parent fceafa1929
commit a97c441e18
1 changed files with 3 additions and 1 deletions

View File

@ -537,7 +537,9 @@ Providing initial data for the forms
... '0': {'subject': 'Hello', 'sender': 'user@example.com'}, ... '0': {'subject': 'Hello', 'sender': 'user@example.com'},
... '1': {'message': 'Hi there!'} ... '1': {'message': 'Hi there!'}
... } ... }
>>> wiz = ContactWizard.as_view([ContactForm1, ContactForm2], initial_dict=initial) >>> # This example is illustrative only and isn't meant to be run in
>>> # the shell since it requires an HttpRequest to pass to the view.
>>> wiz = ContactWizard.as_view([ContactForm1, ContactForm2], initial_dict=initial)(request)
>>> form1 = wiz.get_form('0') >>> form1 = wiz.get_form('0')
>>> form2 = wiz.get_form('1') >>> form2 = wiz.get_form('1')
>>> form1.initial >>> form1.initial