Changes between Version 8 and Version 9 of CookBookManipulatorCustomManipulator


Ignore:
Timestamp:
Jul 15, 2006, 2:54:09 PM (18 years ago)
Author:
Brantley
Comment:

if (manipulator.form) is now the prefered way to check if the manipulator is done.

Legend:

Unmodified
Added
Removed
Modified
  • CookBookManipulatorCustomManipulator

    v8 v9  
    8383    manipulator = PollEdit(poll)    # Create the manipulator.
    8484    manipulator.process(request)    # Process the request.
    85     if (manipulator.done):          # If we are done, redirect to the poll view page.
     85    if (manipulator.form):          # If we are done, redirect to the poll view page.
     86         return render_to_response('polls/edit_form', {'form': manipulator.form})
     87    else:                           # Otherwise, we render the form.
    8688         return HttpResponseRedirect("/polls/%d" % poll.id)
    87     else:                           # Otherwise, we render the form.
    88          return render_to_response('polls/edit_form', {'form': manipulator.form})
     89
    8990}}}
    9091
     
    114115    manipulator = PollAdd()             # Create the manipulator
    115116    poll = manipulator.process(request) # Process the request
    116     if (manipulator.done):              # Are we done processing?
     117    if (manipulator.form):              # Are we done processing?
     118         return render_to_response('polls/new_form', {'form': manipulator.form})
     119    else:                               # Otherwise, respond with the form.
    117120         return HttpResponseRedirect("/polls/%d" % poll.id)
    118     else:                               # Otherwise, respond with the form.
    119          return render_to_response('polls/new_form', {'form': manipulator.form})
    120121}}}
Back to Top