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
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
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
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
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
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
6 matches
Mail list logo