views:

157

answers:

1

Hey,

I am using "url" tag in my template and everything works fine, except I cant capture anything thats behind it. Since I have multiple filters on that page, that are kept via GET request in the url, I need to be able to apend them to it. What happens is, that when I select one filter url will change to some/url/?f=1, then when I select another filter previous filter will get overriden, since the url is just some/url without request.

Here is a piece from urls.py:

url('^products/$', products_list, name = 'products_list'),

Is there anyway to modify it so the url tag will capture the GET request? Or do I need to create a filter which will add it there?

Any help is appreciated

Regards

+3  A: 

There is no way to generate a query string using the url tag. If you need to add a query string to the output then do it manually, e.g. {% url foo bar %}?var={{ val|urlencode }}.

Ignacio Vazquez-Abrams