Opened 3 years ago

Closed 3 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: master
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 aaugustin)

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
determined.

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@…> 3 years ago.
17162-2.diff (3.4 KB) - added by Bradley Ayers <bradley.ayers@…> 3 years ago.
trac-17162.diff (3.5 KB) - added by steph 3 years ago.
get_prefix without request

Download all attachments as: .zip

Change History (10)

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

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

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

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

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

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

  • Has patch set

comment:3 Changed 3 years ago by aaugustin

  • Description modified (diff)

Fixed formatting.

comment:4 Changed 3 years ago by aaugustin

  • Triage Stage changed from Unreviewed to Design 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 3 years ago by jezdez

  • Patch needs improvement set
  • Triage Stage changed from Design decision needed to Accepted

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 3 years ago by steph

get_prefix without request

comment:6 Changed 3 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 3 years ago by julien

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

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