Did I find the right examples for you? yes no

All Samples(26)  |  Call(20)  |  Derive(0)  |  Import(6)
When constucting a form wizard, the wizard needs to be composed of a
sequental series of steps in which it is to display forms to the user and
collect the data from those forms. To be able to provide these forms to the
:ref:`SessionWizard <api_sessionwizard>`, you must first wrap the Django
:class:`django.forms.Form` in a ``Step`` object. The ``Step`` object gives
the ability to store the :class:`django.forms.Form` class to be used, as
well as, a unique slug to be used in the wizard navigation.

.. versionadded:: 0.1
(more...)

src/d/j/django-merlin-0.8/src/merlin/tests/fixtures/testproject/urls.py   django-merlin(Download)
from django.conf.urls.defaults import *
 
from merlin.tests.fixtures.testproject.wizard import MockWizard
from merlin.wizards.utils import Step
from merlin.wizards.session import SessionWizard
urlpatterns = patterns('',
    url(r'^simpletest$', SessionWizard([
        Step('user-details', forms.UserDetailsForm),
        Step('contact-details', forms.ContactDetailsForm)])),
    url(r'^simpletest/(?P<slug>[A-Za-z0-9_-]+)$', SessionWizard([
        Step('user-details', forms.UserDetailsForm),
        Step('contact-details', forms.ContactDetailsForm)])),

src/d/j/django-merlin-HEAD/src/merlin/tests/fixtures/testproject/urls.py   django-merlin(Download)
from django.conf.urls.defaults import *
 
from merlin.tests.fixtures.testproject.wizard import MockWizard
from merlin.wizards.utils import Step
from merlin.wizards.session import SessionWizard
urlpatterns = patterns('',
    url(r'^simpletest$', SessionWizard([
        Step('user-details', forms.UserDetailsForm),
        Step('contact-details', forms.ContactDetailsForm)])),
    url(r'^simpletest/(?P<slug>[A-Za-z0-9_-]+)$', SessionWizard([
        Step('user-details', forms.UserDetailsForm),
        Step('contact-details', forms.ContactDetailsForm)])),

src/d/j/django-merlin-0.8/src/merlin/tests/test_session_wizard.py   django-merlin(Download)
from merlin.wizards import MissingStepException, MissingSlugException
from merlin.wizards.session import SessionWizard
from merlin.wizards.utils import Step
 
 
    def test_type_error_if_session_wizard_is_not_list(self):
        try:
            SessionWizard((
                Step('user-details', forms.UserDetailsForm),
                Step('contact-details', forms.ContactDetailsForm))

src/d/j/django-merlin-HEAD/src/merlin/tests/test_session_wizard.py   django-merlin(Download)
from merlin.wizards import MissingStepException, MissingSlugException
from merlin.wizards.session import SessionWizard
from merlin.wizards.utils import Step
 
 
    def test_type_error_if_session_wizard_is_not_list(self):
        try:
            SessionWizard((
                Step('user-details', forms.UserDetailsForm),
                Step('contact-details', forms.ContactDetailsForm))

src/d/j/django-merlin-0.8/src/merlin/tests/fixtures/testproject/wizard.py   django-merlin(Download)
from django.http import HttpResponse
 
from merlin.tests.fixtures.testproject import forms
from merlin.wizards.session import SessionWizard
from merlin.wizards.utils import Step
    def process_step(self, request, current_step, form):
        if current_step.slug == 'user-details':
            few_more_things_step = Step('few-more-things', forms.FewMoreThingsForm)
            self.insert_after(request, current_step, few_more_things_step)
 
            social_step = Step('social-info', forms.SocialForm)

src/d/j/django-merlin-HEAD/src/merlin/tests/fixtures/testproject/wizard.py   django-merlin(Download)
from django.http import HttpResponse
 
from merlin.tests.fixtures.testproject import forms
from merlin.wizards.session import SessionWizard
from merlin.wizards.utils import Step
    def process_step(self, request, current_step, form):
        if current_step.slug == 'user-details':
            few_more_things_step = Step('few-more-things', forms.FewMoreThingsForm)
            self.insert_after(request, current_step, few_more_things_step)
 
            social_step = Step('social-info', forms.SocialForm)