Opened 12 years ago

Closed 12 years ago

#17162 closed New feature (fixed)

Remove WizardView.get_wizard_name()

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

Description (last modified by Aymeric Augustin)

I propose removing WizardView.get_wizard_name. I think this is a good idea
because currently it seems like get_wizard_name is essentially just the current implementation of
get_prefix. get_wizard_name isn't used anywhere else, and adds the burden of
being an API that would need to be maintained. Essentially this would just mean moving
the contents of get_wizard_name into get_prefix.

I also propose changing WizardView.get_prefix to accept request, *args, **kwargs. This would allow for greater flexibility in how the prefix is

My current use-case is that I want to be able to have multiple incomplete wizards
in progress at the same time. I then want to have the wizard prefix in the URL,
so that a user is able to navigate to the different incomplete instances of the wizard
that they're currently completing. I've achieved this for my situation by reimplementing WizardView.dispatch and WizardView.get_prefix, but my above suggestion would simplify this.

Attachments (3)

17162.diff (3.2 KB) - added by Bradley Ayers <bradley.ayers@…> 12 years ago.
17162-2.diff (3.4 KB) - added by Bradley Ayers <bradley.ayers@…> 12 years ago.
trac-17162.diff (3.5 KB) - added by steph 12 years ago.
get_prefix without request

Download all attachments as: .zip

Change History (10)

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

Attachment: 17162.diff added

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

Attachment: 17162-2.diff added

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

Forgot to remove docs for get_wizard_name(), fixed in 17162-2.diff.

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

Has patch: set

comment:3 Changed 12 years ago by Aymeric Augustin

Description: modified (diff)

Fixed formatting.

comment:4 Changed 12 years ago by Aymeric Augustin

Triage Stage: UnreviewedDesign decision needed

Indeed, it doesn't seem useful to have get_wizard_name in the public API. Since this is a new feature, we can still adjust the API without running into backward compatibility issues.

I'll let the original author make the decision.

comment:5 Changed 12 years ago by Jannis Leidel

Patch needs improvement: set
Triage Stage: Design decision neededAccepted

Technically I agree, this is an unneeded duplication, but get_prefix shouldn't take a request parameter since it's already available on wizard view level as self.request.

Changed 12 years ago by steph

Attachment: trac-17162.diff added

get_prefix without request

comment:6 Changed 12 years ago by steph

.. just added a new patch and removed the get_wizard_name method. I think this is ready for checkin.

comment:7 Changed 12 years ago by Julien Phalip

Resolution: fixed
Status: newclosed

In [17234]:

Fixed #17162 -- Removed the useless WizardView.get_wizard_name() method. Thanks, Bradley Ayers and Stephan Jaekel.

Note: See TracTickets for help on using tickets.
Back to Top