diff options
| author | Stephan Jaekel <steph@rdev.info> | 2013-01-12 13:09:30 +0100 |
|---|---|---|
| committer | Stephan Jaekel <steph@rdev.info> | 2013-03-23 12:24:34 +0100 |
| commit | b614c47f8c05f8c29a974dac984d0f07c3a09fce (patch) | |
| tree | 4749e016f0c3d7e00875601d5ede4d74660e959e /docs/ref | |
| parent | 930af661abdb4eb7322f1ab06f21df9ed04af43d (diff) | |
Added some class attributes to pass initial form lists to the WizardView without the need to add them in the as_view call.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/formtools/form-wizard.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt index bcffb7716b..f8d46fd291 100644 --- a/docs/ref/contrib/formtools/form-wizard.txt +++ b/docs/ref/contrib/formtools/form-wizard.txt @@ -245,6 +245,13 @@ wizard's ``as_view()`` method takes a list of your (r'^contact/$', ContactWizard.as_view([ContactForm1, ContactForm2])), ) +.. versionchanged:: 1.6 + +You can also pass the form list as a class attribute named ``form_list``. + + class ContactWizard(WizardView): + form_list = [ContactForm1, ContactForm2] + .. _wizard-template-for-each-form: Using a different template for each form @@ -295,6 +302,14 @@ The ``urls.py`` file would contain something like:: (r'^checkout/$', OrderWizard.as_view(FORMS, condition_dict={'cc': pay_by_credit_card})), ) +.. versionchanged:: 1.6 + +The ``condiction_dict`` can be passed as attribute for the ``as_view()`` +method or as a class attribute named ``condition_dict``. + + class OrderWizard(WizardView): + condition_dict = {'cc': pay_by_credit_card} + Note that the ``OrderWizard`` object is initialized with a list of pairs. The first element in the pair is a string that corresponds to the name of the step and the second is the form class. @@ -550,6 +565,11 @@ Providing initial data for the forms The ``initial_dict`` can also take a list of dictionaries for a specific step if the step is a ``FormSet``. + .. versionchanged:: 1.6 + + The ``initial_dict`` can also be added as a class attribute named + ``initial_dict`` to avoid having the initial data in the ``urls.py``. + .. _wizard-files: Handling files |
