On Mon, 2009-03-02 at 23:51 +0100, KrcK wrote: > Hi, > > I would like to know how can I do the next. > I want to put a queryset into a context and > then use render_to_response() to render one template like example.html, > which contains one form with some hidden fields. This form submits data to > another url and I've to use another view to do it. The problem is when I want > to get in this new view the previous queryset. > > I don't know how can I do it, so I need your help.
You can't pass the queryset itself around, since that doesn't get sent back to the client's browser: it's only used to render the template. Instead, you'll need to include some information in the form that allows you to reconstruct the queryset. Perhaps some hidden fields that describe just enough information to recreate it. The most extreme case would be some kind of serialised version of the data from the queryset (e.g. a JSON dump), although that's potentially a lot of information to ship back and forth. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---