Hi,
I am confused on how to best use the post/redirect/get pattern for the  
following problem:

Part of the application I am writing is a basic file manager, i.e. it  
lists directory contents to users and lets users download files or  
upload a file to the directory. Upon upload the file is renamed (to  
include date and user) and then saved to disk, users that need to be  
informed receive an email that a new file was uploaded.

My basic idea would be to use the same URL and view/template for  
getting the directory listing and posting a file for uploading to it.  
If a file is uploaded successfully the renamed file name and the users  
that received the email should be listed in a notification part of the  
template (i.e. <div class="notice">...) which confirms to the user  
that everything is ok.

Now I am stuck on how to best do this. POST/REDIRECT/GET does not seem  
to fit here, since HttpResponseRedirect cannot pass any parameters to  
a template and redirecting to the same URL does not make sense anyway.  
What other pattern could/should I use?

Right now I am just doing a render_to_response with the same template,  
regardless of whether it is a first GET of the page or the POST for  
the file upload. Of course this means once a file was uploaded and the  
notification is displayed any refresh of the will give you a browser  
warning about resending data which I would like to avoid.

Any suggestions?


Thanks
Stefan



--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to