Initial values for formwizard form

2009-11-17 Thread geraldcor
Hello all, I began making a form that used request.user.get_profile to get default values for company name, phone, email etc. I have since decided to move to a formwizard to split things up. I have no idea how to override methods for the formwizard class to be able to include those initial values

Re: Initial values for formwizard form

2009-11-18 Thread geraldcor
Ok, Here is how I do it if I am using a regular form with a regular view: profile = request.user.get_profile() form = MyForm('company': profile.defaultcompany, 'contact': profile.defaultcontact, etc...}) return render_to_response('forms/submit.html', {'form': form}, context_instance=RequestContex

Re: Initial values for formwizard form

2009-11-18 Thread Mark L.
On Nov 19, 1:28 am, geraldcor wrote: > Ok, > > Here is how I do it if I am using a regular form with a regular view: > > profile = request.user.get_profile() > form = MyForm('company': profile.defaultcompany, 'contact': > profile.defaultcontact, etc...}) > return render_to_response('forms/submit

Re: Initial values for formwizard form

2009-11-19 Thread geraldcor
This worked perfectly. Thank you. I used parse_params because I needed to add default company profile stuff to the first wizard form. Thank you again for clearing up my ignorance. Greg On Nov 18, 9:10 pm, "Mark L." wrote: > On Nov 19, 1:28 am, geraldcor wrote: > > > > > Ok, > > > Here is how I

Re: Initial values for formwizard form

2009-12-02 Thread geraldcor
So I successfully used this method to add initial values using parse_params as I was dealing with step 0. However, now the client wants the form order changed so that what was step 0 is now step 2. I tried using process_step in the exact same way as parse_params, but the values are not filled in. I

Re: Initial values for formwizard form

2009-12-02 Thread geraldcor
Ok, so I'm a little embarrassed as usual. basically I was checking for a step without defining it. I assumed I could just use the step that is passed but that didn't seem to work for the if statement. So I just eliminated the if statement and all is well. Not perfect, but I can at least move on. O