diff options
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 4cfd1d8f71..b920478700 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 |
