Etienne, thanks for answering, > I believe you got this wrong a little. A HttpResponse object doesn't modify > the query string. That should be done in your form markup, > or even in a javascript file, in case you want to do it programmatically.
Yes, I understand that a HttpResponse cannot modify the query string. What I really want is a behavior, which looks like modifying the query string, but in fact is a common submit/response practice that I do not know how to implement. This is what I need: - user enters a query form (through a 1st GET request), - user selects some filtering options (e.g. combo, check box) and then presses the submit button (thus I receive a POST request) - system sends an HTTP response with the query result and the same filtering options set by the user. However, I wish that the same filtering options set by the user (that I received through a POST), do also appear in the query string. Is there any way to do that? Or I'm completely wrong on what I'm trying to do? I carefully read the Django "Request and response objects" docs, but I can't find a strightforward way to get this behavior done. If you know of any example or code snippet for such behavior, please let me know. On 13 Feb, 22:40, "Etienne Robillard" <[EMAIL PROTECTED]> wrote: > I'll try to help ya a little... > > > I receive a request via GET and, based on request.GET, I generare a > > result and send a HttpResponse. However, when sending the response, > > I'd like to set additional parameters in the query string. > > > For example, suppose I receive the following request: > > > http://domain.com/myurl/myform/?query=whatever > > I believe you got this wrong a little. A HttpResponse object doesn't modify > the query string. That should be done in your form markup, > or even in a javascript file, in case you want to do it programmatically. > > > Then, my form will query the database, build the result set and send a > > initial HTTP response. Then the user will (for example) toggle a > > "order by" option. Now, what I would like is to return a HttpResponse > > but ALSO, extend the query string, for example > > > http://domain.com/myurl/myform/?query=whatever&orderby=foo > > > so that on the next request.GET I find the new "orderby" parameter. > > Nothing prevent's you to use another view which could then handle > this new POSTed parameter. > > > > > This seems a tremendously common and simple problem. However, I'm not > > finding a way to solve it. If I use a HttpResponseRedirect instead of > > an HttpResponse, what I get is a "Found a cyclic link" problem. > > > Any suggestion? > > I suggest you > read:http://www.djangoproject.com/documentation/request_response/ > > Regards, > Etienne --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---