not a bad solution, but you could most likely make the link generator/decoder work in your view handler rather than needing to hit the database. That would prevent the necessity of some method to clean up the db of old temp links that are no longer valid.
On Saturday, November 17, 2018 at 9:27:03 AM UTC-5, Joel wrote: > > Hi Jason, > Thank you for responding. > I solved this by implementing a temporary link system in my model. This > would generate a unique key which points to a foreign key which references > the data I want. When the url with this foreign key is clicked, the pdf is > generated on the fly and presented as a FileResponse. On the javascript > side, what I do is generate the link when the button is clicked, and insert > a Download button in the DOM and the href is set to the link presented by > django. > > Sincerely yours, > > Dr Joel G Mathew > > > > On Sat, 17 Nov 2018 at 19:16, Jason <jjohn...@gmail.com <javascript:>> > wrote: > >> check out >> https://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users...@googlegroups.com <javascript:>. >> To post to this group, send email to django...@googlegroups.com >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/181a3c12-8b08-4220-b95d-b6fc02002c18%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/181a3c12-8b08-4220-b95d-b6fc02002c18%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cbce15cb-a91a-4174-ac87-b595372a3320%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.