in Education by
I want to implement a simple 2 part FormWizard. Form 1 will by dynamically generated something like this: class BuyAppleForm(forms.Form): creditcard = forms.ChoiceField(widget = forms.RadioSelect) type = forms.ChoiceField(widget = forms.RadioSelect) def __init__(self,*args, **kwargs): user = kwargs['user'] del kwargs['user'] super(BuyAppleForm, self).__init__(*args, **kwargs) credit_cards = get_credit_cards(user) self.fields['creditcard'].choices = [(card.id,str(card)) for card in credit_cards] apple_types= get_types_packages() self.fields['type'].choices = [(type.id,str(type)) for type in apple_types] This will dynamically create a form with lists of available choices. My second form, I actually want no input. I just want to display a confirmation screen containing the credit card info, apple info, and money amounts (total, tax, shipping). Once user clicks OK, I want the apple purchase to commence. I was able to implement the single form way by passing in the request.user object in the kwargs. However, with the FormWizard, I cannot figure this out. Am I approaching the problem wrong and is the FormWizard not the proper way to do this? If it is, how can the Form __init__ method access the user object from the HTTP request? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I haven't used it, but for the situation you describe, it seems like you may want to try the FormPreview instead of the FormWizard. From the documentation it sounds like what you're after.

Related questions

0 votes
    tl;dr How to autofill an editable form with information stored in database Hey, Im creating a profile page ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I want to create a form that shows 2 different textboxes with a minimum and a maximum value of my ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I have a very long forms.py and I'd like to split it to smaller parts with as few as possible ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 4, 2022 in Education by JackTerrance
0 votes
    State whether the following statements are true or false with reasons: 1. Foreign Policy is always dynamic. 2. India has not signed NNPT or CTBT. Please answer the above question....
asked Aug 18, 2022 in Education by JackTerrance
0 votes
    I am currently trying to create an autocomplete with a source that is stored in a javascript variable but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I want to have a more interactive dashboard. like reading the data from database , giving it to select ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    Imagine a function which dynamically adds attributes to an object using setattr. The reason for doing so is that I want ... , 'some/attached/device') dev.some.subtree.element = 5...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I want to using sumifs function in VBA. And result paste in same column as previous data. JavaScript ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I'm builtin an web resume-generator to learn how to develop for web. I've made a HTML form which ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I'm builtin an web resume-generator to learn how to develop for web. I've made a HTML form which ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I write a lot of dynamically generated content (developing under PHP) and I use jQuery to add extra ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I am creating facebook comment box,it works fine with the static urls, but my url contains the query ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    Can we create Dynamic Classes in Objective C? If Yes, Explain how to create with a valid use case?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    So in my project, I have a model Chat with many Messages. I want to have ChatSerializer with ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I have a POST request that passes data to my database when the form is submitted. Photo of what I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
...