List Info

Thread: newforms, form.save(), and getting the object I just saved




newforms, form.save(), and getting the object I just saved
country flaguser name
United States
2007-06-28 08:37:06
Using newforms, I do form.save(), and then need to get the
object I
just saved. How can I do this?

Here's the flow:

User submits form. If valid, it's saved, and I need to take
them to a
review page. At this point, the object has an
"active" boolean set to
false.

The review page needs a paypal form built, which is where I
get into
needing the object (or at the very least, its ID).

The paypal form will send them along for payment processing,
passing
along a return URL, something like /object/id/

When it returns to that URL, I'll switch the active field to
True.

But as near as I can tell, to build the review page I'm
going to need
to know the object I've saved. Complicating matters, if I
try to do
anything other than ResponseRedirect after the save, I throw
an error.
I know why, but in my case, with the status set to
inactive,
duplicates aren't too much of a concern.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )