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." <mark.l...@gmail.com> wrote:
> On Nov 19, 1:28 am, geraldcor <gregco...@gmail.com> wrote:
>
>
>
> > Ok,
>
> > Here is how I do it if I am using a regularformwith 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=RequestContext(request))
>
> > pretty simple and basic.
>
> > How do I do this with aformwizard?
>
> > Greg
>
> > On Nov 17, 3:39 pm, geraldcor <gregco...@gmail.com> wrote:
>
> > > Hello all,
>
> > > I began making aformthat 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
> > > thoseinitialvalues in theform. Can someone please help me with this
> > > problem or point me to the proper help? I have come up short with all
> > > of my searching. Thanks.
>
> Hello,
>
> The *initial* values for the forms in aformwizardare stored in the
> self.initial[] list. It means, that to set setinitialvalues for theformin 
> step X you do the following:
>
> init = {
>     'key1':'val1',
>     'key2':'val2',
>     etc..
>
> }
>
> self.initial[X] = init
>
> The best (and, indeed, about the only place to handle this) is the
> process_step method of thewizardinstance (or parse_params, if you
> need to setinitialvalues for theformin step 0).
>
> Hope that helps
>
> Mark

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=.


Reply via email to