Opened 12 years ago

Closed 12 years ago

#19433 closed Cleanup/optimization (fixed)

Allow declaration form_list and condition_dict in WizzardView subclass, not as params to as_view

Reported by: migajek Owned by: steph
Component: contrib.formtools Version: 1.4
Severity: Normal Keywords: cbv wizzard wizzardview
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,
every standard django CBV allows for declaring some attributesin the subclass to avoid passing them to as_view function in urls.py module.
Unfortunately this does not apply to WizzardView, which does not allow a declaration of form_list nor condition_dict in a WizzardView subclass - each of these must be passed as an argument to as_view function.

Since we need to subclass the view anyway (to define form processing function) AND the condition_dict contains a view logics, I believe the proper place for those attributes would be views.py - WizardView subclass, NOT urls.py - as_view params.

example code provided here http://stackoverflow.com/q/13669033/146248

Change History (5)

comment:1 by Florian Apolloner, 12 years ago

Triage Stage: UnreviewedAccepted

Can you write a pull request for this?

comment:2 by steph, 12 years ago

I just wrote some code to make it possible to pass the form lists and condition dicts as class attributes instead of as_view arguments. It would be cool if someone reviews https://github.com/stephrdev/django/commit/3a793aa9487e317876bf29e48f87b984da085205

comment:3 by steph, 12 years ago

Owner: changed from nobody to steph
Status: newassigned

comment:4 by Jannis Leidel, 12 years ago

Triage Stage: AcceptedReady for checkin

Other than versionchanged additions in the docs this looks good to me..

comment:5 by Jannis Leidel <jannis@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In f2c55d2ee1b161b8ea96bed446deb45c63039e0a:

Merge pull request #943 from stephrdev/trac-19433

Fixed #19433 -- Added some class attributes to pass initial form lists to the WizardView.

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