have a look at ticket
http://code.djangoproject.com/ticket/3218

it contains a proposed wizard class for newforms - simply subclass it,
override the done() method and then instantiate it with a list of
newform classes...

if you need more functionality (dynamic forms etc.) you will have to
override more methods (process_step() )

if you have any questions/feature requests please ask away I am
desperate for some feedback... ;)

Honza

On 1/12/07, gordyt <[EMAIL PROTECTED]> wrote:
>
> Howdy Bram,
>
> Here is an example of something that I am doing with newforms and
> sessions and it seems to work very well.  In my case I have a search
> form displayed.  Depending upon the options that are selected by the
> user, when they submit the form it will be handled by one of several
> different view methods.  But they all need access to the information in
> the form so I save it in the session first when the search form is
> submitted.
>
> First, here is the view that displays the form:
>
> @login_required
> def search(request):
>     """
>     Serve the main search screen
>     """
>     if request.method == "POST":
>         edit_form = SearchForm(request.POST)
>         if edit_form.is_valid():
>             for k in edit_form.fields:
>                 if k in request.session: del request.session[k]
>             for k in edit_form.data:
>                 request.session[k] = edit_form[k].data
>             return HttpResponseRedirect( "/kindledb/search/%s/" %
> request.POST['search_type'] )
>     else:
>         edit_form = SearchForm()
>     return render_to_response("kindledb/search.html",
>         {'edit_form': edit_form})
>
> Note that when the form is submitted, the first thing it does is clear
> out any session data from the last time this search page was called up.
>  If you don't do that you can end up with stuff hanging around from
> previous searches.
>
> Then it stores all of the information from the newform instance into
> the request.session.  Then it redirects to the appropriate next view.
>
> In that next view, it has access to all of the information that was
> saved in the session.  This works out really well because they are all
> paginated generic object_lists.  So the user can navigate through the
> resulting information no problem.
>
> In your case, you could keep shoving stuff in the request.session if
> you had several pages of forms that they user had to go through.
>
> --gordy
>
>
> >
>


-- 
Honza Král
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

--~--~---------~--~----~------------~-------~--~----~
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