Django creation wizard - submitting a view request?

Is there a way to access the request variable in the done () method of the Form Wizard?

 class AddWizard(SessionWizardView): def done(self, form_list, **kwargs): if form_list[0].cleaned_data['ad_type'] == '1': ad_type = 'basic' else: ad_type = 'other' return render_to_response('business/done.html', { 'form_data': ad_type, }, context_instance = RequestContext(request) ) 

I want to access the user object that is in the request, but I'm not sure how to pass the done () method transfer to me?

+4
source share
1 answer

Yes. SessionWizardView extends the basic generic View , so the request is available in self.request .

Docs: https://docs.djangoproject.com/en/1.5/topics/class-based-views/generic-display/#dynamic-filtering

+7
source

Source: https://habr.com/ru/post/1411424/


All Articles