I'm having problems with a save method taking too long and the user
thinking there is a problem with the website so they hit refresh which
causes the data to be submitted multiple times.

I have this in the view:
-------------------------------------
if form.is_valid():
  form.save()
  return HttpResponseRedirect('/thanks/')
-------------------------------------

The save method takes a little time.  It saves to db, sends a couple
of emails, and interfaces with another software package(which is the
time hog).  I want to be able to show the thanks page and then call
the save method.

It seems like celery(http://www.celeryproject.org/) is the best
choice.  When I read the doc it said because of race conditions, be
careful of passing models to celery tasks.  With my form I want it to
save a unique instance for every time the form is submitted so I think
I can pass the form to the task.

Does anyone have suggestions or other recommendations about this?  Is
there an easier way to do this?

Brian

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to