On 6/26/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > > Ok, I *think* I understand your problem a bit better. > > > > One thing you can do is store some information (filename, or > > something) in the session object for the user. Then it doesn't matter > > how long it takes for the user to press the button (unless of course > > they wait days, and expire the cookie). > > > Thank you for your answer. > > Would you mind sending me some link where such an example is > implemented, if possible? > > It's easier to code with an example.
What do you need to see? How to write AJAX code, or how to store information in a session? I don't really have any links on how to do AJAX in Django (you can search through the mailing list, there have been some threads in the past). Storing stuff in sessions is relatively easy, and documented nicely in the main docs. To store something in a session, you just do: request.session["some_key"] = some_data Where 'some_key' is any key you want, and some_data is the data you want to store. I've done this myself in the past by generating a temporary file in one view (using Python's tempfile module to make sure it's unique), and storing it in the session. Then in another view (say, a view that gets called when the user presses a button) I can pull the filename out of the user's session. Jay P. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---