Skip to main content

A Django template tag to modify url's query string.

Project description

Django QUrl Template Tag

https://img.shields.io/pypi/v/django-qurl-templatetag.svg https://img.shields.io/travis/sophilabs/django-qurl-templatetag.svg Documentation Status Updates

A Django template tag to modify url’s query string.

Installation

pip install -e git+https://github.com/sophilabs/django-qurl-templatetag.git#egg=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

Append, remove or replace query string parameters from an url (preserve order)

{% 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' %}

About

https://res.cloudinary.com/jsconfuy/image/upload/c_pad,f_auto,h_200,w_200,e_trim/v1426608244/xuwbunompvfjaxuazlwo.png

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


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page