Opened 14 years ago
Closed 14 years ago
#16382 closed Bug (fixed)
WizardView: Incorrect step numbering
| Reported by: | anonymous | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.formtools | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | vvangelovski@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I am using the example template from the following page of the documentation:
https://docs.djangoproject.com/en/dev//ref/contrib/formtools/form-wizard/#creating-templates-for-the-forms
With Django version SVN-16488, this template renders the first step as Step 0 of 3 rather than Step 1 of 3. Subsequent steps are also zero-based.
Also, what is the difference between step0, index and current? These all appear to produce the same result.
Attachments (1)
Change History (10)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
This seems like a doc bug, should be using something like:
<p>Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}</p>
by , 14 years ago
| Attachment: | form-wizard.diff added |
|---|
comment:4 by , 14 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
- current = the zero based step number for WizardView or the step name for NamedUrlWizardView
- index = always a zero based step number
- step1 = always a one based step number
- step0 = a alias for index to have a more intuitive way to get the step number
comment:5 by , 14 years ago
| Resolution: | invalid |
|---|---|
| Status: | closed → reopened |
comment:7 by , 14 years ago
| Cc: | added |
|---|
comment:8 by , 14 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
By default the array index is used as step title. You can overwrite the name of each step.
# doc example in url.py (r'^$', ContactWizard.as_view([("1", ContactForm1), ("2", ContactForm2)])),