-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #9200 -- Added new form wizard to formtools based on class base…
…d views. Many thanks to Stephan Jäkel, ddurham and ElliottM for their work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16307 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
Showing
39 changed files
with
2,594 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,43 @@ | |||
from django import forms | |||
from django.contrib.formtools.wizard import FormWizard | |||
from django.http import HttpResponse | |||
|
|||
class Page1(forms.Form): | |||
name = forms.CharField(max_length=100) | |||
thirsty = forms.NullBooleanField() | |||
|
|||
class Page2(forms.Form): | |||
address1 = forms.CharField(max_length=100) | |||
address2 = forms.CharField(max_length=100) | |||
|
|||
class Page3(forms.Form): | |||
random_crap = forms.CharField(max_length=100) | |||
|
|||
class ContactWizard(FormWizard): | |||
def done(self, request, form_list): | |||
return HttpResponse("") | |||
|
|||
class TestForm(forms.Form): | |||
field1 = forms.CharField() | |||
field1_ = forms.CharField() | |||
bool1 = forms.BooleanField(required=False) | |||
|
|||
class HashTestForm(forms.Form): | |||
name = forms.CharField() | |||
bio = forms.CharField() | |||
|
|||
class HashTestBlankForm(forms.Form): | |||
name = forms.CharField(required=False) | |||
bio = forms.CharField(required=False) | |||
|
|||
class WizardPageOneForm(forms.Form): | |||
field = forms.CharField() | |||
|
|||
class WizardPageTwoForm(forms.Form): | |||
field = forms.CharField() | |||
|
|||
class WizardPageTwoAlternativeForm(forms.Form): | |||
field = forms.CharField() | |||
|
|||
class WizardPageThreeForm(forms.Form): | |||
field = forms.CharField() |
26 changes: 13 additions & 13 deletions
26
...ts/formwizard/templates/forms/wizard.html → ...rmtools/tests/templates/forms/wizard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,13 @@ | |||
<html> | <html> | ||
<body> | <body> | ||
<p>Step {{ step }} of {{ step_count }}</p> | <p>Step {{ step }} of {{ step_count }}</p> | ||
<form action="." method="post"> | <form action="." method="post"> | ||
<table> | <table> | ||
{{ form }} | {{ form }} | ||
</table> | </table> | ||
<input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> | <input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> | ||
{{ previous_fields|safe }} | {{ previous_fields|safe }} | ||
<input type="submit"> | <input type="submit"> | ||
</form> | </form> | ||
</body> | </body> | ||
</html> | </html> |
9 changes: 0 additions & 9 deletions
9
django/contrib/formtools/tests/templates/formwizard/wizard.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
from django.contrib.formtools.wizard.legacy import FormWizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
from django import forms | |||
|
|||
class ManagementForm(forms.Form): | |||
""" | |||
``ManagementForm`` is used to keep track of the current wizard step. | |||
""" | |||
current_step = forms.CharField(widget=forms.HiddenInput) |
Oops, something went wrong.