{ "info": { "author": "Paylogic International", "author_email": "developers@paylogic.com", "bugtrack_url": null, "classifiers": [], "description": "django-urlconverter: Django automatic view parameters conversion\n================================================================\n\nThe ``django-urlconverter`` package provides an easy way to convert view arguments\nfrom simple types to complex ones, like models, or just do some processing using robust syntax.\nMost interesting application of the package is to convert view arguments which are object ids (from database via ORM)\nto the instances of those objects (Models).\n\n\n.. image:: https://api.travis-ci.org/paylogic/django-urlconverter.png\n :target: https://travis-ci.org/paylogic/django-urlconverter\n.. image:: https://pypip.in/v/django-urlconverter/badge.png\n :target: https://crate.io/packages/django-urlconverter/\n.. image:: https://coveralls.io/repos/paylogic/django-urlconverter/badge.png?branch=master\n :target: https://coveralls.io/r/paylogic/django-urlconverter\n\n\nInstallation\n------------\n\n.. sourcecode:: sh\n\n pip install django-urlconverter\n\n\nUsage\n-----\n\nmodels.py:\n\n.. code-block:: python\n\n from django.db import models\n\n\n class FooBar(models.Model):\n \"\"\"Foo Bar model.\"\"\"\n title = models.CharField(max_length=100)\n\nconverters.py:\n\n.. code-block:: python\n\n from .models import FooBar\n\n\n class Foo(object):\n \"\"\"Foo converter. Convert an object id to FooBar instance.\"\"\"\n def __init__(self, **kwargs):\n self.kwargs = kwargs\n\n def __call__(self, value, request, *args, **kwargs):\n return FooBar.objects.get(pk=value)\n\nsettings.py:\n\n.. code-block:: python\n\n URL_CONVERTERS = {\n 'Foo': 'converters.Foo', # Converts to 'FooBar instance'\n }\n\nurls.py:\n\n.. code-block:: python\n\n from django.conf.urls.defaults import patterns\n from django_urlconverter import converted_arguments_url\n\n urlpatterns = patterns('views',\n converted_arguments_url(r'^foos//', 'bar'),\n )\n\nviews.py:\n\n.. code-block:: python\n\n def bar(request, foo2):\n \"\"\"View function which gets a converted foo2.\n the foo2 will be a converted parameter, which is the result of Foo converter\n \"\"\"\n return foo2.title\n\n\nContact\n-------\n\nIf you have questions, bug reports, suggestions, etc. please create an issue on\nthe `GitHub project page `_.\n\n\nLicense\n-------\n\nThis software is licensed under the `MIT license `_\n\nSee ``_\n\n\n\u00a9 2013 Paylogic International.\n\nChangelog\n=========\n\n\n1.0.0\n-----\n\n* Initial public release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-urlconverter", "package_url": "https://pypi.org/project/django-urlconverter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-urlconverter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-urlconverter/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Django URL converters", "version": "1.0.0" }, "last_serial": 1329703, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "3969379f541a96eaa5d363c5d6eacc5a", "sha256": "5846ab8bbe3bf2c9672d0105da915c8d7b50fc31dc4ca9a031283801c0b1181b" }, "downloads": -1, "filename": "django-urlconverter-0.2.tar.gz", "has_sig": false, "md5_digest": "3969379f541a96eaa5d363c5d6eacc5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5487, "upload_time": "2014-04-09T13:36:42", "url": "https://files.pythonhosted.org/packages/4c/f5/27cb522a2e3ab337d4639f2bb4a48d95c80264c52b0592bcb12b275e07b5/django-urlconverter-0.2.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "c5668ddeba7056377b6637f7f4c3b767", "sha256": "46d2c40adb44c7132b29ad744052cacaa50f19e16ad61f06cc972e3a79aa983d" }, "downloads": -1, "filename": "django-urlconverter-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c5668ddeba7056377b6637f7f4c3b767", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5479, "upload_time": "2014-12-03T14:42:01", "url": "https://files.pythonhosted.org/packages/b7/b4/20bfcb04c2afea531e7d3b56c294ca34c7b7bbece82ed005c51edafd4569/django-urlconverter-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c5668ddeba7056377b6637f7f4c3b767", "sha256": "46d2c40adb44c7132b29ad744052cacaa50f19e16ad61f06cc972e3a79aa983d" }, "downloads": -1, "filename": "django-urlconverter-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c5668ddeba7056377b6637f7f4c3b767", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5479, "upload_time": "2014-12-03T14:42:01", "url": "https://files.pythonhosted.org/packages/b7/b4/20bfcb04c2afea531e7d3b56c294ca34c7b7bbece82ed005c51edafd4569/django-urlconverter-1.0.0.tar.gz" } ] }