A Django template tag to modify url's query string.
Project description
Django QUrl Template Tag
A Django template tag to modify url’s query string.
Documentation
The full documentation is at https://django-url-templatetag.readthedocs.org.
Quick Start
Install Django QUrl Template Tag:
pip install django-qurl-templatetag
After installation is done, add qurl_templatetag to the INSTALLED_APPS setting in your settings.py file:
INSTALLED_APPS = (
# …
'qurl_templatetag',
# …
)
Usage
{% load qurl %}
{% qurl url [param]* [as <var_name>] %}
Parameters:
name=value: replace all values of name by one value
name=None: remove all values of name
name+=value: append a new value for name
name-=value: remove the value of name with the value
Example:
{% qurl '/search?page=1&color=blue&color=green' order='name' page=None color+='red' color-='green' %}
Output: /search?color=blue&order=name&color=red
{% qurl request.get_full_path order='name' %}
Tests
$ pip install -r requirements/test.pip
$ python runtests.py
About
Django Qurl Template Tag is maintained and funded by sophilabs, inc. The names and logos for sophilabs are trademarks of sophilabs, inc.
History
0.0.3 (2016-11-14)
Third release on PyPI.
0.0.2 (2016-09-29)
Second release on PyPI.
0.0.1 (2013-11-14)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-qurl-templatetag-0.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81018bfc0285fffded65a5bcff27be8164af5c9b9a8304fc923a9ae0b57c7cde |
|
MD5 | 9460eebed6bbaf15a59695a1bac26fca |
|
BLAKE2b-256 | 71fa8c518217fdd00642bd52f67991088aa8cf6bb8bc1a27b65774744748aae8 |