Skip to content

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

License

Notifications You must be signed in to change notification settings

nessita/django-qurl-templatetag

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-qurl-templatetag

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

https://travis-ci.org/sophilabs/django-qurl-templatetag.png?branch=master

Installation

pip install -e git+https://github.com/sophilabs/django-qurl-templatetag.git#egg=django-qurl-templatetag

After installation is done, add qurltemplatetag to the INSTALLED_APPS setting in your settings.py file:

INSTALLED_APPS = (
    # …
    'qurltemplatetag',
)

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

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published