diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-07-15 18:28:55 +0200 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2024-07-15 13:29:54 -0300 |
| commit | 91a5b5a4bbc20f5033060ba43f505c667270ecd3 (patch) | |
| tree | 446bbb58ee72cde5cd7705e4abf47efb03e88db1 /docs/ref | |
| parent | bdfcda8c2694ebd4d0ca32f09f8cb0eb1c2be060 (diff) | |
[5.1.x] Refs #10941 -- Renamed query_string template tag to querystring.
Backport of 27043bde5b795eb4a605aeca1d3bc4345d2ca478 from main.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 8ad73b835f..5b67658250 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -952,9 +952,9 @@ output (as a string) inside a variable. This is useful if you want to use {% now "Y" as current_year %} {% blocktranslate %}Copyright {{ current_year }}{% endblocktranslate %} -.. templatetag:: query_string +.. templatetag:: querystring -``query_string`` +``querystring`` ---------------- .. versionadded:: 5.1 @@ -975,14 +975,14 @@ query string is ``?color=green&size=M``, the output would be .. code-block:: html+django - {% query_string %} + {% querystring %} You can also pass in a custom ``QueryDict`` that will be used instead of ``request.GET``: .. code-block:: html+django - {% query_string my_query_dict %} + {% querystring my_query_dict %} Each keyword argument will be added to the query string, replacing any existing value for that key. With the query string ``?color=blue``, the following would @@ -990,14 +990,14 @@ result in ``?color=red&size=S``: .. code-block:: html+django - {% query_string color="red" size="S" %} + {% querystring color="red" size="S" %} It is possible to remove parameters by passing ``None`` as a value. With the query string ``?color=blue&size=M``, the following would result in ``?size=M``: .. code-block:: html+django - {% query_string color=None %} + {% querystring color=None %} If the given parameter is a list, the value will remain as a list. For example, if ``my_list`` is set to ``["red", "blue"]``, the following would result in @@ -1005,7 +1005,7 @@ if ``my_list`` is set to ``["red", "blue"]``, the following would result in .. code-block:: html+django - {% query_string color=my_list %} + {% querystring color=my_list %} A common example of using this tag is to preserve the current query string when displaying a page of results, while adding a link to the next and previous @@ -1015,14 +1015,14 @@ would output ``?color=blue&size=M&page=4``: .. code-block:: html+django - {% query_string page=page.next_page_number %} + {% querystring page=page.next_page_number %} You can also store the value in a variable, for example, if you need multiple links to the same page with syntax such as: .. code-block:: html+django - {% query_string page=page.next_page_number as next_page %} + {% querystring page=page.next_page_number as next_page %} .. templatetag:: regroup |
