Author: julien
Date: 2011-12-19 05:52:40 -0800 (Mon, 19 Dec 2011)
New Revision: 17236

Modified:
   django/trunk/django/contrib/formtools/tests/wizard/__init__.py
   django/trunk/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py
   django/trunk/django/contrib/formtools/wizard/storage/cookie.py
   django/trunk/django/contrib/formtools/wizard/views.py
Log:
Fixed #17408 -- Cleaned up some namings in `contrib.formtools`. Thanks, Stephan 
Jaekel.

Modified: django/trunk/django/contrib/formtools/tests/wizard/__init__.py
===================================================================
--- django/trunk/django/contrib/formtools/tests/wizard/__init__.py      
2011-12-19 13:36:32 UTC (rev 17235)
+++ django/trunk/django/contrib/formtools/tests/wizard/__init__.py      
2011-12-19 13:52:40 UTC (rev 17236)
@@ -4,8 +4,8 @@
 from django.contrib.formtools.tests.wizard.namedwizardtests.tests import (
     NamedSessionWizardTests,
     NamedCookieWizardTests,
-    TestNamedUrlSessionFormWizard,
-    TestNamedUrlCookieFormWizard,
+    TestNamedUrlSessionWizardView,
+    TestNamedUrlCookieWizardView,
     NamedSessionFormTests,
     NamedCookieFormTests,
 )

Modified: 
django/trunk/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py
===================================================================
--- 
django/trunk/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py    
    2011-12-19 13:36:32 UTC (rev 17235)
+++ 
django/trunk/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py    
    2011-12-19 13:52:40 UTC (rev 17236)
@@ -321,24 +321,24 @@
         instance.render_done(None)
         self.assertEqual(instance.storage.current_step, 'start')
 
-class TestNamedUrlSessionFormWizard(NamedUrlSessionWizardView):
+class TestNamedUrlSessionWizardView(NamedUrlSessionWizardView):
 
     def dispatch(self, request, *args, **kwargs):
-        response = super(TestNamedUrlSessionFormWizard, 
self).dispatch(request, *args, **kwargs)
+        response = super(TestNamedUrlSessionWizardView, 
self).dispatch(request, *args, **kwargs)
         return response, self
 
-class TestNamedUrlCookieFormWizard(NamedUrlCookieWizardView):
+class TestNamedUrlCookieWizardView(NamedUrlCookieWizardView):
 
     def dispatch(self, request, *args, **kwargs):
-        response = super(TestNamedUrlCookieFormWizard, self).dispatch(request, 
*args, **kwargs)
+        response = super(TestNamedUrlCookieWizardView, self).dispatch(request, 
*args, **kwargs)
         return response, self
 
 
 class NamedSessionFormTests(NamedFormTests, TestCase):
-    formwizard_class = TestNamedUrlSessionFormWizard
+    formwizard_class = TestNamedUrlSessionWizardView
     wizard_urlname = 'nwiz_session'
 
 
 class NamedCookieFormTests(NamedFormTests, TestCase):
-    formwizard_class = TestNamedUrlCookieFormWizard
+    formwizard_class = TestNamedUrlCookieWizardView
     wizard_urlname = 'nwiz_cookie'

Modified: django/trunk/django/contrib/formtools/wizard/storage/cookie.py
===================================================================
--- django/trunk/django/contrib/formtools/wizard/storage/cookie.py      
2011-12-19 13:36:32 UTC (rev 17235)
+++ django/trunk/django/contrib/formtools/wizard/storage/cookie.py      
2011-12-19 13:52:40 UTC (rev 17236)
@@ -20,7 +20,7 @@
         except KeyError:
             data = None
         except BadSignature:
-            raise SuspiciousOperation('FormWizard cookie manipulated')
+            raise SuspiciousOperation('WizardView cookie manipulated')
         if data is None:
             return None
         return json.loads(data, cls=json.JSONDecoder)

Modified: django/trunk/django/contrib/formtools/wizard/views.py
===================================================================
--- django/trunk/django/contrib/formtools/wizard/views.py       2011-12-19 
13:36:32 UTC (rev 17235)
+++ django/trunk/django/contrib/formtools/wizard/views.py       2011-12-19 
13:52:40 UTC (rev 17236)
@@ -111,9 +111,9 @@
     @classonlymethod
     def as_view(cls, *args, **kwargs):
         """
-        This method is used within urls.py to create unique formwizard
+        This method is used within urls.py to create unique wizardview
         instances for every request. We need to override this method because
-        we add some kwargs which are needed to make the formwizard usable.
+        we add some kwargs which are needed to make the wizardview usable.
         """
         initkwargs = cls.get_initkwargs(*args, **kwargs)
         return super(WizardView, cls).as_view(**initkwargs)
@@ -126,7 +126,7 @@
 
         * `form_list` - is a list of forms. The list entries can be single form
           classes or tuples of (`step_name`, `form_class`). If you pass a list
-          of forms, the formwizard will convert the class list to
+          of forms, the wizardview will convert the class list to
           (`zero_based_counter`, `form_class`). This is needed to access the
           form for a specific step.
         * `initial_dict` - contains a dictionary of initial data dictionaries.
@@ -139,7 +139,7 @@
           apply.
         * `condition_dict` - contains a dictionary of boolean values or
           callables. If the value of for a specific `step_name` is callable it
-          will be called with the formwizard instance as the only argument.
+          will be called with the wizardview instance as the only argument.
           If the return value is true, the step's form will be used.
         """
         kwargs.update({
@@ -168,13 +168,13 @@
                 # we need to override the form variable.
                 form = form.form
             # check if any form contains a FileField, if yes, we need a
-            # file_storage added to the formwizard (by subclassing).
+            # file_storage added to the wizardview (by subclassing).
             for field in form.base_fields.itervalues():
                 if (isinstance(field, forms.FileField) and
                         not hasattr(cls, 'file_storage')):
                     raise NoFileStorageConfigured
 
-        # build the kwargs for the formwizard instances
+        # build the kwargs for the wizardview instances
         kwargs['form_list'] = init_form_list
         return kwargs
 
@@ -215,7 +215,7 @@
         After processing the request using the `dispatch` method, the
         response gets updated by the storage engine (for example add cookies).
         """
-        # add the storage engine to the current formwizard instance
+        # add the storage engine to the current wizardview instance
         self.prefix = self.get_prefix(*args, **kwargs)
         self.storage = get_storage(self.storage_name, self.prefix, request,
             getattr(self, 'file_storage', None))
@@ -517,7 +517,7 @@
 
         .. code-block:: python
 
-            class MyWizard(FormWizard):
+            class MyWizard(WizardView):
                 def get_context_data(self, form, **kwargs):
                     context = super(MyWizard, 
self).get_context_data(form=form, **kwargs)
                     if self.steps.current == 'my_step_name':
@@ -642,7 +642,7 @@
     def post(self, *args, **kwargs):
         """
         Do a redirect if user presses the prev. step button. The rest of this
-        is super'd from FormWizard.
+        is super'd from WizardView.
         """
         wizard_goto_step = self.request.POST.get('wizard_goto_step', None)
         if wizard_goto_step and wizard_goto_step in self.get_form_list():
@@ -661,7 +661,7 @@
 
     def render_next_step(self, form, **kwargs):
         """
-        When using the NamedUrlFormWizard, we have to redirect to update the
+        When using the NamedUrlWizardView, we have to redirect to update the
         browser's URL to match the shown step.
         """
         next_step = self.get_next_step()

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to