Hi,

I need to use some kind of box (thickbox or other) popping up in front
of any page that a user is redirected to after successfully
registering a new account. The user gets redirected to the page she
initially opened before being sent to the registration form. So it
could be any page on the site. So I need a function that catches a
messages on every page. What I did is putting a reference to that
message in the base template that is inherited everywhere as such:
{{ pop_up_message }}. If there is nothing sent to that variable then
nothing happens and the page loads without popping anything. If there
is something in that variable then the corresponding pop_up box is
called via javascript.

Now it gives me 2 problems.

First, the variable {{ pop_up_message }} can only be filled if I
reload the same page and set it in the context. For example in the
registration process, if the form doesn't validate at the time of
sending it via POST the variable is set to display an error pop up
message and the template reloads with that message filled. But if the
registration process validates then a redirect occurs and I am unable
to set this variable in the context or pass it to the other views. Is
there a way to do that? right now I pass this message in the URL and
the javascript catches it just the same way but it's very ugly and I'm
sure there's another way.

Second, the person who wrote the javascript part of that system tells
me the part where we catch the message to know if a pop up box should
appear or not should be made with Django and not javascript. He tells
me there is a way to write a function that would be executed before
every views to catch this message without having to rewrite every
single view. It sounds really strange and not very Djangoish. Does
such a function exist? Doesn't catching a message on every page is
javascripts' job?

thanks for your light,
Bastien
--~--~---------~--~----~------------~-------~--~----~
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