Re: How to set queryset on the second step of a form wizard?

2008-08-22 Thread rr
http://dpaste.com/73317/ I have dpasted it on the link above Cheers Roy On Aug 21, 2:30 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Aug 21, 11:56 am, rr <[EMAIL PROTECTED]> wrote: > > > The url is herehttp://dpaste.com/72961/ > > I don't see anything glaringly wrong. You mentioned that

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread Rajesh Dhawan
On Aug 21, 11:56 am, rr <[EMAIL PROTECTED]> wrote: > The url is herehttp://dpaste.com/72961/ I don't see anything glaringly wrong. You mentioned that it "complains about 'ChannelTypeForm' object has no attribute 'cleaned_data'"...can you dpaste that error trace as well?

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread rr
The url is here http://dpaste.com/72961/ -r On Aug 21, 9:39 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Aug 21, 2:06 am, rr <[EMAIL PROTECTED]> wrote: > > > sorry for being annoying > > > It doesn't work, complains about > > 'ChannelTypeForm' object has no attribute 'cleaned_data' > >

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread [EMAIL PROTECTED]
Override the process_step method do that when step one is being processed, it creates the queryset to be used by step 2 then. if(step==1): if(form.is_valid()): self.step2_queryset=Book.objects.filter(**form.cleaned_data) elif(step==0): self.step2_queryset=None Then, override the

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread Rajesh Dhawan
On Aug 21, 2:06 am, rr <[EMAIL PROTECTED]> wrote: > sorry for being annoying > > It doesn't work, complains about > 'ChannelTypeForm' object has no attribute 'cleaned_data' > when submit on the second step(step1)http://dpaste.com/72840/ Can you also dpaste your URLs.py that shows which form is

Re: How to set queryset on the second step of a form wizard?

2008-08-21 Thread rr
sorry for being annoying It doesn't work, complains about 'ChannelTypeForm' object has no attribute 'cleaned_data' when submit on the second step(step1) http://dpaste.com/72840/ -r On Aug 21, 1:51 am, rr <[EMAIL PROTECTED]> wrote: > Don't worry.Formworks now. Thanks a lot. > > But would be

Re: How to set queryset on the second step of a form wizard?

2008-08-20 Thread rr
Don't worry. Form works now. Thanks a lot. But would be great if you can explain it a bit on how your code works and the sequence of how process_steps and get_form works as I see it seems called a few time between steps Thanks =) -r On Aug 21, 1:42 am, rr <[EMAIL PROTECTED]> wrote: > It works

Re: How to set queryset on the second step of a form wizard?

2008-08-20 Thread rr
It works well. Thanks a lot. But now another problem. It seems "def done " is not working. It loops back to the step1 and def done is never called And do you mind explain how your code works? I did a "print step" before return form in the def get_from, it prints 0, 1, 0. It seems it has been

Re: How to set queryset on the second step of a form wizard?

2008-08-20 Thread Rajesh Dhawan
On Aug 20, 12:57 pm, rr <[EMAIL PROTECTED]> wrote: > Thanks Rajesh > > But...it doesn't work > It complains about form0 doesn't have cleaned_data. I guess > > form0 = super(MyFormWizard, self).get_form(0, data=data) > > only gives you a form with no data?! I just dpasted something that will

Re: How to set queryset on the second step of a form wizard?

2008-08-20 Thread Rajesh Dhawan
On Aug 20, 12:57 pm, rr <[EMAIL PROTECTED]> wrote: > Thanks Rajesh > > But...it doesn't work > It complains about form0 doesn't have cleaned_data. I guess > > form0 = super(MyFormWizard, self).get_form(0, data=data) > > only gives you a form with no data?! Can you dpaste what you've so far?

Re: How to set queryset on the second step of a form wizard?

2008-08-20 Thread rr
Thanks Rajesh But...it doesn't work It complains about form0 doesn't have cleaned_data. I guess form0 = super(MyFormWizard, self).get_form(0, data=data) only gives you a form with no data?! On Aug 20, 11:06 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > Hi, > > > Depending onstep1's

Re: How to set queryset on the second step of a form wizard?

2008-08-20 Thread Rajesh Dhawan
Hi, > Depending on step 1's selection, I want to set the queryset of one of > the fields (a ModelChoiceField) > > e.g. > class StepOneForm(forms.Form): >channelType = > forms.ModelChoiceField(queryset=ChannelType.objects.all()) > class StepTwoForm(forms.Form): >channel =

How to set queryset on the second step of a form wizard?

2008-08-20 Thread rr
Hi Guru, Depending on step 1's selection, I want to set the queryset of one of the fields (a ModelChoiceField) e.g. class StepOneForm(forms.Form): channelType = forms.ModelChoiceField(queryset=ChannelType.objects.all()) class StepTwoForm(forms.Form): channel = forms.ModelChoiceField()