summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2012-11-01 16:11:05 -0400
committerTim Graham <timograham@gmail.com>2012-11-01 18:02:32 -0400
commitc5d0f49dc285b0c200ad0d1496914f13d8e6293d (patch)
treea3626de431fb77c4a560199cb09964a8ce8145bf /docs/ref
parenta8c415f8447cafb58315aa9b6e7240d46991f445 (diff)
[1.5.X] Added WizardView.file_storage exception message and docs
Thanks Danilo Bargen for the patch. Backport of af7ea808d8 from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/formtools/form-wizard.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt
index d1193badbe..3edc019d05 100644
--- a/docs/ref/contrib/formtools/form-wizard.txt
+++ b/docs/ref/contrib/formtools/form-wizard.txt
@@ -493,6 +493,21 @@ Advanced ``WizardView`` methods
context = self.get_context_data(form=form, **kwargs)
return self.render_to_response(context)
+.. method:: WizardView.get_cleaned_data_for_step(step)
+
+ This method returns the cleaned data for a given ``step``. Before returning
+ the cleaned data, the stored values are revalidated through the form. If
+ the data doesn't validate, ``None`` will be returned.
+
+.. method:: WizardView.get_all_cleaned_data()
+
+ This method returns a merged dictionary of all form steps' ``cleaned_data``
+ dictionaries. If a step contains a ``FormSet``, the key will be prefixed
+ with ``formset-`` and contain a list of the formset's ``cleaned_data``
+ dictionaries. Note that if two or more steps have a field with the same
+ name, the value for that field from the latest step will overwrite the
+ value from any earlier steps.
+
Providing initial data for the forms
====================================
@@ -534,6 +549,16 @@ This storage will temporarily store the uploaded files for the wizard. The
:attr:`file_storage` attribute should be a
:class:`~django.core.files.storage.Storage` subclass.
+Django provides a built-in storage class (see :ref:`the built-in filesystem
+storage class <builtin-fs-storage>`)::
+
+ from django.conf import settings
+ from django.core.files.storage import FileSystemStorage
+
+ class CustomWizardView(WizardView):
+ ...
+ file_storage = FileSystemStorage(location=os.path.join(settings.MEDIA_ROOT, 'photos'))
+
.. warning::
Please remember to take care of removing old files as the