#9200: Add a session based form wizard
-----------------------------------------------+----------------------------
          Reporter:  ddurham                   |         Owner:  ddurham        
     
            Status:  assigned                  |     Milestone:                 
     
         Component:  django.contrib.formtools  |       Version:  SVN            
     
        Resolution:                            |      Keywords:  session wizard 
forms
             Stage:  Accepted                  |     Has_patch:  1              
     
        Needs_docs:  0                         |   Needs_tests:  0              
     
Needs_better_patch:  0                         |  
-----------------------------------------------+----------------------------
Changes (by ddurham):

  * owner:  nobody => ddurham
  * status:  new => assigned

Comment:

 Replying to [comment:23 danaspiegel]:
 > In implementing this code (ddurham, thanks for providing it!), I ran
 into an issue where the usage of ModelForms doesn't work properly when
 stepping back to previous pages. Specifically, when using either
 ForeignKey or ManyToMany relationships, you cannot use the cleaned data to
 re-create new versions of the model instance since the representation of
 the form data for these two field types is different from the way you set
 __init__ data. I've fixed the code to work for my usage, and will try to
 post the changes (though I don't know if they cover all cases or are
 implemented appropriately.
 >
 > I believe this issue must be fixed before this patch is accepted.

 I think I ran into this issue as well.  You can see in the GET method
 where I check if the form is a model form and do things a little
 differently.

         333                 if issubclass(form_class, forms.ModelForm):
         334                     form =
 form_class(instance=form_class.Meta.model(**page_data))
         335                 else:
         336                     form = form_class(initial=page_data)


 Where page_data is the cleaned_data.  If you had to do something
 different, could you post your code?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9200#comment:24>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

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

Reply via email to