Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

FormWizard: file_storage exception message and docs #173

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
4 participants
Contributor

dbrgn commented Jun 25, 2012

Small pull request, easy to review and merge.

  • Provided error message for NoFileStorageConfigured
  • Improved docs regarding file_storage

New commit 03.07.12:

  • Improved docs for WizardView methods

@apollo13 apollo13 and 1 other commented on an outdated diff Jul 2, 2012

docs/ref/contrib/formtools/form-wizard.txt
@@ -474,6 +474,15 @@ 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 builtin 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):
@apollo13

apollo13 Jul 2, 2012

Owner

Missing empty lines here, see pep008

@dbrgn

dbrgn Jul 2, 2012

Contributor

I missed that one, thanks. Fixed with new commit.

@jezdez jezdez commented on an outdated diff Jul 2, 2012

django/contrib/formtools/wizard/storage/base.py
@@ -69,7 +69,9 @@ def get_step_files(self, step):
wizard_files = self.data[self.step_files_key].get(step, {})
if wizard_files and not self.file_storage:
- raise NoFileStorageConfigured
+ raise NoFileStorageConfigured(
+ "You need to define 'file_storage' in your " \
@jezdez

jezdez Jul 2, 2012

Owner

No need for backslashes here, please remove them.

@jezdez jezdez commented on an outdated diff Jul 2, 2012

django/contrib/formtools/wizard/storage/base.py
@@ -82,7 +84,9 @@ def get_step_files(self, step):
def set_step_files(self, step, files):
if files and not self.file_storage:
- raise NoFileStorageConfigured
+ raise NoFileStorageConfigured(
+ "You need to define 'file_storage' in your " \
@jezdez

jezdez Jul 2, 2012

Owner

Again, backslashes.

Contributor

dbrgn commented Jul 2, 2012

@jezdez thanks, done!

Contributor

dbrgn commented Jul 3, 2012

I saw that the WizardView's get_all_cleaned_data() and get_cleaned_data_for_step(step) were still undocumented and added their docstrings to the main documentation.

Maybe get_all_cleaned_data() should even be mentioned in an example at https://docs.djangoproject.com/en/1.4/ref/contrib/formtools/form-wizard/#django.contrib.formtools.wizard.views.WizardView.done? It seems to be very useful (as long as form field names don't clash).

Contributor

dbrgn commented Oct 24, 2012

This is a very small pull request, it would be great if someone could review and merge it :)

Owner

timgraham commented Nov 1, 2012

Made a few tweaks and merged this, thanks!

@timgraham timgraham closed this Nov 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment