Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#16179 closed New feature (fixed)

Formwizard enhancement proposal

Reported by: Harro Owned by: nobody
Component: contrib.formtools Version: dev
Severity: Normal Keywords: dceu2011
Cc: hvdklauw@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'd like to propose the following changes to the formwizard:

Add kwargs to the get_initkwargs method to allow for calling the wizard from the urls.py with changed attributes (storage, template_name)
The reasons behind this that the same wizard might be used in multiple locations and you might for instance want to change the storage backend based on the fact if the user is logged in or not.

Add extra_context as a default attribute and use it in the get_extra_context, this I needed when I tried to get the wizard integrated in the admin add and change views. Here some extra context for the templates is needed to get everything working correctly (breadcrumbs etc). This way a user could specify a wizard that is also used in the frontend without needing to change anything for the admin.

I'll be working on this during the djangocon eu 2011 sprints :)

Attachments (1)

16179.diff (5.6 KB ) - added by Harro 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Harro, 14 years ago

Has patch: set

by Harro, 14 years ago

Attachment: 16179.diff added

comment:2 by Harro, 14 years ago

Cc: Harro added
Keywords: dceu2011 added

comment:3 by Harro, 14 years ago

Cc: Harro removed

comment:4 by Harro, 14 years ago

Cc: hvdklauw@… added

comment:5 by steph, 14 years ago

To add extra context to your template you could override the get_context_data method. I think this is a better approach instead of having more and more code in urls.py files.

comment:6 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: newclosed

In [16368]:

Fixed #16179 -- Extended argument handling of the new WizardView a little to behave the same as the rest of the generic class based views. Also cleaned up the template loading in its tests a bit. Thanks, Harro van der Klauw.

comment:7 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

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