jazzband / django-formtools

A set of high-level abstractions for Django forms
https://django-formtools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
784 stars 135 forks source link

Access URL Parameters in WizardView Templates #238

Open DanielAlderman opened 1 year ago

DanielAlderman commented 1 year ago

Hi there,

I was wondering what is the recommended way of passing URL Parameters into the template of a WizardView?

This is done automatically in templates of generic Django views such as a ListView, I am able to use URL Parameters simply by using the name of the capture parameter.

For example if my URL is defined as path('<location>/', views.CustomerIndexView.as_view(), name='customer_index'),

Then I can access that captured value simply using {{ location }} in my template.

This does not work in the template of a WizardView or one of its descendants. Looking at the kwargs of the view I can see that the captured value is present, but it isn't passed as context to the template, is this by design?