I have requested the page:
example.com/stuff?&type=2&foo=bar&stage=unpublished
I want a link to the page (unset type and foo relative to previous):
example.com/stuff?stage=unpublished
And I want to do it conveniently like:
<a href=?{% url_params_now with foo=None type=None %}">go up</a>
How do I do it? Is there some inbuilt way, or some library?
I use the tedious
{{url}}?{% if type %}type={{type}}{% endif %}&{% if foo %}foo={{foo}}{% endif %}&{% if stage %}stage={{stage}}{% endif %}
?stage=unpublished? You dont need to explicitly set. Also, the best bet is to handle this in the view because nothing stops the user from sending arbitrary GET parameters as a part of the request.