Code

Opened 2 years ago

Closed 2 years ago

#17151 closed Cleanup/optimization (fixed)

Rename 'wizard_prev_step' in NamedUrlWizardView

Reported by: Bradley Ayers <bradley.ayers@…> Owned by: nobody
Component: contrib.formtools Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have a wizard where users can go to any form/page (i.e. they can jump ahead a few forms if they want to), and the field 'wizard_prev_step' is poorly named in this context.

I think a better name would be 'wizard_next_step', this is at least consistent with Django's auth app's ?next=<url> URL style (i.e. "next" meaning "go to this after some action is performed").

If backwards compatibility is a major concern (which is shouldn't be since no Django release contains this stuff yet), perhaps both wizard_prev_step and wizard_next_step should be supported?

Attachments (2)

17151.diff (5.3 KB) - added by Bradley Ayers <bradley.ayers@…> 2 years ago.
trac-17151.diff (5.4 KB) - added by steph 2 years ago.
Patch with goto instead of prev

Download all attachments as: .zip

Change History (12)

comment:1 Changed 2 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I'm not sure I undertand what the issue is here. The "prev" terminology is used throughout the formtools. I for one think it makes sense, since it takes you to the form that was previously posted. Could you elaborate on why this name would be confusing from a developer's standpoint?

comment:2 Changed 2 years ago by Bradley Ayers <bradley.ayers@…>

The issue I have is that it doesn't necessary take you to a previous form. It just takes you to some other form (in the docs example it only takes you backwards).

In my situation I have a few forms which are all optional, and I want the user to be able to jump around between the forms willy-nilly. In this scenario, calling the field wizard_prev_step is wrong, because the user might be moving to the next step.

Changed 2 years ago by Bradley Ayers <bradley.ayers@…>

comment:3 Changed 2 years ago by Bradley Ayers <bradley.ayers@…>

  • Easy pickings set
  • Has patch set

comment:4 Changed 2 years ago by aaugustin

  • Easy pickings unset

wizard_next_step seems confusing to me too, because the primary use of this feature is to return to a previous step. I believe that in the vast majority of cases, users will fill in a form wizard linearly, even if the order isn't enforce by the application.

One could make an argument for wizard_goto_step. I can't really convince myself that it's a better name. In this case, a name that describes the most common case feels more appropriate than a technically accurate one.

comment:5 Changed 2 years ago by aaugustin

  • Triage Stage changed from Unreviewed to Design decision needed

comment:6 Changed 2 years ago by anonymous

"wizard_jump_to_step" or some variation of that is another option

comment:7 Changed 2 years ago by jezdez

  • Triage Stage changed from Design decision needed to Accepted

I wouldn't mind using 'wizard_target_step' or 'wizard_goto_step', too. That said I agree this sounds like a matter of how the specific field is explained in the docs. If you can find a clear explanation of why it should have a more generic name, I'm all for changing the name (before 1.4).

comment:8 Changed 2 years ago by Bradley Ayers <bradley.ayers@…>

I like wizard_goto_step. The project I'm working on requires me to build a "tabbed wizard" -- think Windows file properties window -- where there are multiple tabs that each have a separate form. Essentially it's suppose to be break up a huge form that would normally take up a huge amount of vertical space, into separate tabs that the user can click through.

Here's a screenshot of what it looks like: http://dl.dropbox.com/u/33499139/django/tab-wizard.png

There's no requirement for the user to fill out all the forms, or to fill them out in any particular order. The tabs at the top are actually buttons that, using the current contrib.formwizard in 1.4 are named wizard_prev_step. As you can see it doesn't make any sense to have them named this way, and rather it would make far more sense to name them wizard_goto_step or something similar.

Changed 2 years ago by steph

Patch with goto instead of prev

comment:9 Changed 2 years ago by steph

I just added a new patch with "wizard_goto_step" instead of "wizard_prev_step". I think the requested change is a good thing and should be done before the 1.4 release.

comment:10 Changed 2 years ago by julien

  • Resolution set to fixed
  • Status changed from new to closed

In [17233]:

Fixed #17151 -- Renamed wizard_prev_step to the clearer wizard_goto_step in NamedUrlWizardView. Thanks, Bradley Ayers and Stephan Jaekel.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.