Monday, 15 September 2014

python - How can I access the URL params and use them if I'm using a formwizard in Django? -



python - How can I access the URL params and use them if I'm using a formwizard in Django? -

i'm using django 1.4. i've spent quite while googleing , looking @ docs on django page, https://docs.djangoproject.com/en/1.4/ref/contrib/formtools/form-wizard/ etc. few people have asked question , no-one happens have answered it.

what need is:

use slug paramater urls.py (as follows):

forms=[...] url(r'^url/(?p<slug>[\w-]+)/form/$', wizardwizard.as_view(forms)),

in views.py (as follows):

class wizardwizard(sessionwizardview): template_name = "template.html" extra_context = model.objects.filter(slug=slug) # here! def done(self, form_list, **kwargs): ...

solved problem too. formwizard instance contains self.args , self.kwargs set args , kwargs passed view urlconf. can see in django.views.generic.base.dispatch

python django django-formwizard

No comments:

Post a Comment