I won't claim anything about "right" - but a potential:

Consider assigning an "Id" to the print request and then redirecting to the a url that uses that "Id" as an input to print out a PDF.

i.e. upon post, an ID gets requested and created - say "39" for the sake of argument. Then redirect to /myapp/checkprint/39/ and set up your URL's so that it reads 39 as an argument to the view code assigned to that URL, and that view code generates (or gets) the PDF and returns it with the proper content-type for download.

-joe

On 11/10/06, David S. <[EMAIL PROTECTED]> wrote:

I am looking for advice on best practices.

I have an intranet application running (on Django) for which there is a process
that POSTs a request to print checks.  It is a POST because it creates entries
in the checks table but the result is a PDF file that the user can then print.
But, because I return a PDF file as an attachment to download, the browser stays
on the submit page.  It should really be redirected but I can not make it both
redirect and return a PDF for download... unless I am missing something.

So my solution is to make printing the checks a 2-step process:  "Create" brings
you to a page with a link to download the PDF.

Any thoughts on whether this is the "right" way to do this?  Thanks for any
advice.

Peace,
David S.





--~--~---------~--~----~------------~-------~--~----~
 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