I'm desperate here.  I'm having serious problems with the form
wizard.

In url.py I have:

    url(r'refinance/$', RefinanceWizard([RefinanceForm_1,
RefinanceForm_2, DummyForm, DummyForm]), name='refinance'),

So you can see that I have 4 steps.  The purpose of the DummyForm is
just a place holder.  They will be substituted depending on responses
within earlier steps.  So here's the process_step code for the wizard:

    def process_step(self, request, form, step):
        if isinstance(form, RefinanceForm_2) and
form.__dict__.has_key('cleaned_data'):
            if form.cleaned_data['other_investments'] == 'Y':
                self.form_list[2] = RefinanceForm_3_yes
            else:
                self.form_list[2] = RefinanceForm_3_no

        if isinstance(form, (RefinanceForm_3_yes, RefinanceForm_3_no))
and form.__dict__.has_key('cleaned_data'):
            if form.cleaned_data['mortgage_count'] == '1' or
form.cleaned_data['mortgage_count'] == 1:
                self.form_list[3] = RefinanceForm_4_1
            else:
                self.form_list[3] = RefinanceForm_4_2

So, some notes...  I am using "Y/N" to represent bool values, because
that was broken a few weeks ago and I don't know if I should switch
back to bool values yet (should I - do they work now!?!)

Now the cleaned_data...  You'll notice that I test for a string and an
integer.  I found that using an integer (xxxx = 1 instead of xxxx =
'1') was NEVER triggered so I always went  to the else and
RefinanceForm_4_2 was added.

I thought one of the points of cleaned_data is that the value gets
normalized back to the proper data type.  If this field is an
IntegerField in my model/form, which it is, this should be an integer
when I access the value in cleaned_data.  Correct?

So, the problems I am seeing, which happen very sporadically, are:

1.  When step 4 is submitted (the last step), I get an traceback
telling me DummyForm has no save method, mind you, everything up to
and including the last step seemed to have worked fine and I already
substituted all the dummy forms with the proper ones.

2.  When I submit RefinanceForm_3, and look at the value of
mortgage_count, I'll often get a blank RefinanceForm_4, which I'm
assuming is the DummyForm that is actually being shown.  This will
also happen on occasion where RefinanceForm_3 is not displayed and the
DummyForm does.

Its to the point where I document every value I enter, for ~40 fields,
and try to recreate the problem.  Sometimes it works and sometimes it
doesn't.  I don't know where its failing - maybe the hashing and
validating stuff in the wizard??  No exceptions are getting raised...

I'm not even sure I'm using the process_step function correctly, as
there's no samples in the documentation...

Suggestions?

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

Reply via email to