{ "info": { "author": "Andrew Godwin", "author_email": "andrew@aeracode.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "urlman\n------\n\n.. image:: https://travis-ci.org/andrewgodwin/urlman.svg?branch=master\n :target: https://travis-ci.org/andrewgodwin/urlman\n :alt: Test Status\n\n.. image:: https://codecov.io/gh/andrewgodwin/urlman/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/andrewgodwin/urlman\n :alt: Test Coverage Status\n\nA nicer way to do URLs for Django models.\n\nReplaces things like ``get_absolute_url`` with a ``.urls`` attribute that\ncan reference other URLs and build sensible trees of things, and can\nthen be accessed using ``instance.urls.name``.\n\nThis is so you can have URLs on your model instances directly (rather than reversing\nthrough the url lookup functions, which is not only slow but often hard to supply\narguments to). You can just throw ``{{ instance.urls.view }}`` into a template to get\na link.\n\nIt also lets you use Python string formatting syntax to place arguments into URLs from\nthe model instance itself or from other URLs in the same set.\n\nExample:\n\n.. code-block:: python\n\n import urlman\n\n model Group(models.Model):\n\n ...\n\n class urls(urlman.Urls):\n view = \"/{self.slug}/\"\n users = \"{view}users/\"\n admin = \"{view}admin/\"\n\n\n def my_view(request):\n group = ...\n return redirect(group.urls.view)\n\nIt's suggested that you use \"view\" as the equivalent name for\n``get_absolute_url``, and have a function like this on your model:\n\n.. code-block:: python\n\n def get_absolute_url(self):\n return self.urls.view\n\nTo build a full URL use the ``full`` method like this:\n\n.. code-block:: python\n\n def my_view(request):\n group = ...\n return redirect(group.urls.admin.full(scheme='https'))\n\nYou can implement the `get_scheme(url)` and `get_hostname(url)` methods on your\n`Url` class to change your default theme and hostname from the urlman defaults\nof `'http'` and `'localhost'`, respectively.\n\nIf you use Django REST Framework, you can use ``urlman.UrlManField`` to provide\nan object with a set of URLs. It is used like this (only the ``urls`` parameter\nis required)::\n\n from urlman import UrlManField\n\n class MySerializer(ModelSerializer):\n urls = UrlManField(urls=['view', 'edit'], attribute='urls', full=True)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/andrewgodwin/urlman", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "urlman", "package_url": "https://pypi.org/project/urlman/", "platform": "", "project_url": "https://pypi.org/project/urlman/", "project_urls": { "Homepage": "https://github.com/andrewgodwin/urlman" }, "release_url": "https://pypi.org/project/urlman/1.3.0/", "requires_dist": null, "requires_python": "", "summary": "Django URL pattern helpers", "version": "1.3.0" }, "last_serial": 5674636, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "ea2f80e545f970f15304b072e12a66fc", "sha256": "f7a86de5692bc66a8cdd2844e43dcaf6c62b2959bb9fb55aa3b3ca66852b01a3" }, "downloads": -1, "filename": "urlman-1.0.tar.gz", "has_sig": false, "md5_digest": "ea2f80e545f970f15304b072e12a66fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2265, "upload_time": "2015-08-25T07:19:37", "url": "https://files.pythonhosted.org/packages/f3/5b/adaf461bc0eba1ef316f6c3adffa0c4e6d3a9ea0c78c2818f03e5f3ee618/urlman-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6765fedc17823c6faaf189b0bd2a3a3f", "sha256": "af1da046870ca1a15b89c805066f4b4cae5a3699049d62787e93ee77f90c5554" }, "downloads": -1, "filename": "urlman-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6765fedc17823c6faaf189b0bd2a3a3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2277, "upload_time": "2015-09-10T19:30:27", "url": "https://files.pythonhosted.org/packages/24/95/286e7910af6866a5cce8862894981b874301ea8d60246e7ff12cd3f17aaa/urlman-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "31f35d6267107d63c4f7a7198ed89c3e", "sha256": "874ac585d82a9f69545ffd8bf30ebf6b4911e196576e75b440d29591e95f1342" }, "downloads": -1, "filename": "urlman-1.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "31f35d6267107d63c4f7a7198ed89c3e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 3659, "upload_time": "2017-04-25T05:32:35", "url": "https://files.pythonhosted.org/packages/17/c3/27291f04951839365b2ab9ad188a0c4d5c35924f30351eda937be0315c06/urlman-1.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8dd26a791ba17c3bd838b989bf810b79", "sha256": "78c452db255e759c81f468ff72a387299f78620d0b6b535b90736a793fbc8c23" }, "downloads": -1, "filename": "urlman-1.1.0.tar.gz", "has_sig": false, "md5_digest": "8dd26a791ba17c3bd838b989bf810b79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2906, "upload_time": "2017-04-25T05:32:33", "url": "https://files.pythonhosted.org/packages/b9/6d/04ed4776eb24b40d2612474834b0dac61acf2c51f70e9c0109238cdb8802/urlman-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "7d174c24a93ec5c9e3e4764a9255c05a", "sha256": "4764e0f6106128ae1b3b78e1c460720e3a2608c3a00d90b12ae0edc2e15b46fb" }, "downloads": -1, "filename": "urlman-1.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "7d174c24a93ec5c9e3e4764a9255c05a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5442, "upload_time": "2017-12-07T18:19:02", "url": "https://files.pythonhosted.org/packages/e1/c5/2c08897d7978c89c4d57c601b1e979daf610e782034f053f31a8d47695da/urlman-1.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9085ab50f4ea1b423fd389e7aa58a9d2", "sha256": "32d8d3fca062be7dee97d144dff08f312d4f444d28550e0a38651c02353c75c8" }, "downloads": -1, "filename": "urlman-1.2.0.tar.gz", "has_sig": false, "md5_digest": "9085ab50f4ea1b423fd389e7aa58a9d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3599, "upload_time": "2017-12-07T18:19:01", "url": "https://files.pythonhosted.org/packages/bb/73/c89b3aba7d2a71d8ca9990cc1dbe5b36e31b16b4730b950425487154a3e6/urlman-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "3f9ad688e44171df963f6055b0e635a2", "sha256": "0cbdbf96c771baaf0be7f08fbc15501f96d3d6a886c74a337e1671d2e7a5c65c" }, "downloads": -1, "filename": "urlman-1.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "3f9ad688e44171df963f6055b0e635a2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5963, "upload_time": "2019-08-14T03:45:09", "url": "https://files.pythonhosted.org/packages/b0/bd/91428346f5dfb1d691811ae5739aee94c30be5efe03e18ef7280a14c6891/urlman-1.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dd445c5299963d6e8f1a5c1018df64ca", "sha256": "dbb82fdab1ffa1797e5e77dce131d6a4f02c4d2047663692d184f51b67991c4f" }, "downloads": -1, "filename": "urlman-1.3.0.tar.gz", "has_sig": false, "md5_digest": "dd445c5299963d6e8f1a5c1018df64ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3944, "upload_time": "2019-08-14T03:45:10", "url": "https://files.pythonhosted.org/packages/c7/11/c29022dc98afa98335f200d71bff3207501f741f6074c64940de01a0012b/urlman-1.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f9ad688e44171df963f6055b0e635a2", "sha256": "0cbdbf96c771baaf0be7f08fbc15501f96d3d6a886c74a337e1671d2e7a5c65c" }, "downloads": -1, "filename": "urlman-1.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "3f9ad688e44171df963f6055b0e635a2", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5963, "upload_time": "2019-08-14T03:45:09", "url": "https://files.pythonhosted.org/packages/b0/bd/91428346f5dfb1d691811ae5739aee94c30be5efe03e18ef7280a14c6891/urlman-1.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dd445c5299963d6e8f1a5c1018df64ca", "sha256": "dbb82fdab1ffa1797e5e77dce131d6a4f02c4d2047663692d184f51b67991c4f" }, "downloads": -1, "filename": "urlman-1.3.0.tar.gz", "has_sig": false, "md5_digest": "dd445c5299963d6e8f1a5c1018df64ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3944, "upload_time": "2019-08-14T03:45:10", "url": "https://files.pythonhosted.org/packages/c7/11/c29022dc98afa98335f200d71bff3207501f741f6074c64940de01a0012b/urlman-1.3.0.tar.gz" } ] }