On Mar 26, 5:58 pm, Bill Freeman <ke1g...@gmail.com> wrote: > Actually, by the time your user can click a button the "result-set" is no > longer around, because thecontextis no longer around (render and the > view function have returned). All that's left is the rendered representation. > > I see two possibilities: > > 1. You render the data into a hidden form which gets POSTed to the view > that exports it. POST doesn't have a data size problem. > > 1a. You make the rendered version be via form fields which get POSTed. > You can mark the inputs readonly, but that wouldn't stop a determined > bad guy from posting modified fields. > > You could also hide the stuff in JavaScriptvariables, but then your page > won't work for folks who disable JavaScript. > > This consumes a lot of parsing effort by the submit view. > > 2. For the first view you computed the data somehow (DB query?). If you > can repeat the computation and get the same answer in the view that > handles the button submission, just recompute it (requerry...). If part of > the computation is expensive, you could also squirrel the data in a DB > table based cache (you walk it periodically to find stuff old enough to > expunge). > > On Thu, Mar 25, 2010 at 6:17 PM, Kasto <kastoro...@gmail.com> wrote: > > Hi, > > > I am looking to implement an "Export to Excel sheet" feature. The > > result-set is already available and rendered in the template. I need > > to provide a link or button to export result to Excel sheet. > > > Result-set is a set of listvariablesand cannot be passed over GET > > request due to length limitations. > > > Two solutions that I can think of are: > > > 1. Use hidden form fields and submit it back to a view that creates > > Excel sheet. > > 2. Directly pass object list to view using reverse() or URL regex. > > > I have been unable to pass lists using URL Regex. Is it possible to > > pass listvariablesfrom template back to the view? If so, how? > > > Appreciate ur help! > > > Kasto > > --
Is there a possibility to store longer term data in the session variable (assuming one is dealing with logged-in users)? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.