{ "info": { "author": "Ivan Ivanov", "author_email": "ivan@ivanovs.info", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Append, remove or replace query string parameters from a url (preserve order).\nOriginally created by Sophilabs - https://github.com/sophilabs/django-qurl-templatetag\n\n\n\nInstallation\n============\n.. code-block::\n\n pip install -e git+https://github.com/obiwanus/django-qurl.git#egg=django-qurl\n\nUsage in templates\n==================\n\nExample:\n\n.. code-block::\n\n {% load qurl %}\n\n {% qurl '/search?page=1&color=blue&color=green' order=name page-- color+=red color-=green %}\n Output: /search?color=blue&order=name&color=red\n\n {% qurl request.get_full_path order='name' %}\n Output: /your/current/path/?order=name\n\nParameters:\n\n.. code-block::\n\n name=value: replace all values of name by one value\n name--: remove all values of name\n name+=value: append a new value for name\n name-=value: remove the value of name with the value\n\nUsing reverse in the template tag:\n\n.. code-block::\n\n {% qurl 'url_name' [reverse_params] | order=name color+=red color+=green %}\n Output: /reversed/url/?order=name&color=red&color=green\n\nThe reverse syntax is exactly the same as in the standard Django ``{% url %}``\ntag.\n\n\nUsage in views\n==============\n\nExamples:\n\n.. code-block:: python\n\n from qurl import qurl\n\n url = '/testurl/1/'\n qurl(url, add={'a': 'a1', 'b': ['b1', 'b2']})\n # Output: /testurl/1/?a=a1&b=b1&b=b2\n\n url = '/testurl/1/?a=a1&b=b1&b=b2'\n qurl(url, add={'a': 'a2'}, remove=['b'])\n # Output: /testurl/1/?a=a2\n\n url = '/testurl/1/?a=a1&b=b1&b=b2'\n qurl(url, add={'a': ['a2']}, remove=['b'])\n # Output: /testurl/1/?a=a1&a=a2\n\n url = '/testurl/1/?a=a1&b=b1&b=b2'\n qurl(url, exclude={'b': 'b2'}, add={'a': 'a2'})\n # Output: /testurl/1/?a=a1&a=a2&b=b1\n\n # You can use request.GET as a base\n url = '/testurl/1/'\n qurl(url, add=request.GET, exclude={'b': 'b1'}\n\nNotes:\n------\n\nIf you want to assign a specific value to the parameter (replacing all\nexisting values), use ``add={'param': 'value'}``.\n\nIf you want to add a value to already existing ones, use\n``add={'param': ['value']}``. You can add more than one value of course.\n\nPlease check the tests for more usage examples.\n\n\nRunning tests\n-------------\n\nPlease make sure `tox `_ is installed and run\n``tox`` from the command line.\n\nThe source code is hosted on Github: https://github.com/obiwanus/django-qurl/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/obiwanus/django-qurl/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-qurl", "package_url": "https://pypi.org/project/django-qurl/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-qurl/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/obiwanus/django-qurl/" }, "release_url": "https://pypi.org/project/django-qurl/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "A set of tools to append, remove or replace query string parameters from a url (originally created by Sophilabs)", "version": "0.1.1" }, "last_serial": 995555, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fbc0d4211cb3d558fb3be80cc20b953f", "sha256": "933d34a86d9da7b97fc59a8421d78f8e9d0b2dd39bc4af7eccb97552d4d64853" }, "downloads": -1, "filename": "django-qurl-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fbc0d4211cb3d558fb3be80cc20b953f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2560, "upload_time": "2014-02-03T06:31:05", "url": "https://files.pythonhosted.org/packages/b6/03/060738e72c23acb18327a72272b3d17b106b1eaf902eacff964470d2da8c/django-qurl-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "690462fc4d4258efe6e652cb60602b6c", "sha256": "2f1a1b8b3a212240e3a028a34653b738d2caecacca095e5a875e603dd3f8a290" }, "downloads": -1, "filename": "django-qurl-0.1.1.tar.gz", "has_sig": false, "md5_digest": "690462fc4d4258efe6e652cb60602b6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3786, "upload_time": "2014-02-09T20:11:26", "url": "https://files.pythonhosted.org/packages/41/80/b1c163a481914c08b34838545c0c62828e742500383755083407bdf0c44c/django-qurl-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "690462fc4d4258efe6e652cb60602b6c", "sha256": "2f1a1b8b3a212240e3a028a34653b738d2caecacca095e5a875e603dd3f8a290" }, "downloads": -1, "filename": "django-qurl-0.1.1.tar.gz", "has_sig": false, "md5_digest": "690462fc4d4258efe6e652cb60602b6c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3786, "upload_time": "2014-02-09T20:11:26", "url": "https://files.pythonhosted.org/packages/41/80/b1c163a481914c08b34838545c0c62828e742500383755083407bdf0c44c/django-qurl-0.1.1.tar.gz" } ] }