@shravster –
In urls.py, have something like this:
========================
# urls.py
from django.conf.urls.defaults import *
from mysite import views as root
urlpatterns = patterns('',
(r'^message/send/$',
root.message_send),
(r'^message/failed/(?P<error_message>)/$',
root.message_failed),
(r'^message/succeeded/$',
root.message_succeeded),
)
========================
And your view functions would look like this:
========================
# views.py
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
def message_send(request)
# primary message_send logic goes here
# . . .
if success:
return HttpResponseRedirect('/message/success/')
else:
if failed_this_way:
return HttpResponseRedirect(
'/message/failed/this_way')
if failed_that_way:
return HttpResponseRedirect(
'/message/failed/that_way')
else failed_spectacularly:
return HttpResponseRedirect(
'/message/failed/spectacularly')
def message_failed(request, error_message):
template = "%s.html" % error_message
render_to_response(template)
def message_success(request):
# balloons and confetti
========================
Here's an idea: message_failed's template could
{% include "message_send.html" %}
or something more effective, to allow the user to see the error and
then – while in the same page – re-send a message.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---