Add {% querystring %} template tag to add, remove, and update querystring parameters

Review Request #9712 — Created March 1, 2018 and submitted — Latest diff uploaded

Information

Djblets
release-1.0.x
22f8586...

Reviewers

Previously, it was only possible to update a single query parameter with
{% querystring_with %}. However, in the name of future proofing, it
became necessary to make a new template tag {% querystring %}
that can take an arbitrary number of key-value pairs now with different
modes in the form of:

{% querystring “mode” "key1=value1" "key2=value2" %}

The three different modes are:
“remove” - Will remove keys from the query string.
“append” - Will append values for its given key without overwriting.
“update” - Will add to or replace part of a query string.

Ran unit tests.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 18. See what's changed.

orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
djblets/util/templatetags/djblets_utils.py
djblets/util/tests/test_djblets_utils_tags.py
Loading...