Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11847 closed (invalid)

FormWizard in urlconf is not reversable

Reported by: rnm@… Owned by: nobody
Component: contrib.formtools Version: 1.1
Severity: Keywords: formwizard url reverse
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The recommended way to use a FormWizard is to embed the FormWizard into the urlconf (where it'll be called with call, and operates like a view). However, any template that uses the "url" tag to reverse a view won't work with this.

Fix: don't embed the FormWizard directly into urlconf; wrap it in a view (how? haven't had any luck with this)
Workaround: add another entry to urlconf for the _same_ url, pointing to a view that does nothing. Use this view as the 'url' tag parameter in the template.

I acknowledge this is really ugly.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by Honza_Kral

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The recommended way to do that would be to use the named url mappings. See http://docs.djangoproject.com/en/dev/topics/http/urls/#id2 for details

comment:2 Changed 5 years ago by rnm@…

Great, thanks for the tip, much better workaround. Does FormWizard need a default behavior, like a standard view?

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.