{ "info": { "author": "David Thenon", "author_email": "sveetch@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.5", "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. _breadcrumb: http://en.wikipedia.org/wiki/Breadcrumb_%28navigation%29#Websites\r\n.. _Django internationalization system: https://docs.djangoproject.com/en/dev/topics/i18n/\r\n\r\nIntroduction\r\n============\r\n\r\n**AutoBreadcrumbs** is a Django application to automatically build a breadcrumb in your website like\r\nthis : ::\r\n\r\n Home > Some page > Some child page\r\n\r\nEach *crumb* displays a title with a link to represent a view, the crumb tree is determined from the urls map\r\nof your project, their titles and links are determined from the associated view entries in the breadcrumbs\r\nregistry.\r\n\r\nRequires\r\n********\r\n\r\nSince the **0.9** version, it requires at least Django 1.5, for Django 1.4 you\r\nwill have to use the **0.8.1.1**, you can find him in the github releases.\r\n\r\nLinks\r\n*****\r\n\r\n* Download his `PyPi package `_;\r\n* Clone it on his `Github repository `_;\r\n\r\nInstall\r\n=======\r\n\r\nIn your *settings* file add **AutoBreadcrumbs** to your installed apps :\r\n\r\n::\r\n\r\n INSTALLED_APPS = (\r\n ...\r\n 'autobreadcrumbs',\r\n ...\r\n )\r\n\r\nImport default settings: ::\r\n\r\n from autobreadcrumbs.settings import *\r\n\r\nThen register his *context processor* :\r\n\r\n::\r\n\r\n TEMPLATE_CONTEXT_PROCESSORS = (\r\n ...\r\n 'autobreadcrumbs.context_processors.AutoBreadcrumbsContext',\r\n ...\r\n )\r\n\r\nAnd finally, as for the *autodiscover* for the admin site\r\n(``django.contrib.admin``), you will have to add these two lines in your\r\n``urls.py`` project :\r\n\r\n::\r\n\r\n import autobreadcrumbs\r\n autobreadcrumbs.autodiscover()\r\n\r\nThis is optional but if you don't do this, all ``crumbs.py`` file will be\r\nignored and only titles defined in ``settings.AUTOBREADCRUMBS_TITLES`` will be used.\r\n\r\nUsage\r\n=====\r\n\r\nNote that this app will don't work correctly if you don't have a strong organisation in your\r\nurls map.\r\n\r\n* You must ensure that all your urls are correctly named (see\r\n `Naming URL patterns `_);\r\n* Different views must not use the same url;\r\n* If you use url namespace, prefix all your crumb url name with it;\r\n* Regroup your restricted views on some url paths and don't mix them with non-restricted view urls.\r\n\r\nView registration\r\n*****************\r\n\r\nRegistration\r\n------------\r\n\r\nThe *context processor* makes a search from the current url that is splitted in segments which represent\r\nthe crumbs. For each segment, an entry is searched on his URL name in the breadcrumbs registry in this\r\nstep order :\r\n\r\n#. If the name has an entry in ``settings.AUTOBREADCRUMBS_TITLES``, then use it;\r\n#. If the name has an entry in a ``crumbs.py`` file in one of your apps, then use it;\r\n\r\nIf none of these steps succeeds to find the URL name, the ressource will be ignored and not be displayed\r\nin the breadcrumbs.\r\n\r\nIf you need to *hide* a ressource from breadcrumbs, just set his URL name to a *None* value, this will act in\r\nignoring the ressource.\r\n\r\nA crumb title value use the Django template system to be rendered and is aware of the context of the template\r\nwhere it is called, so you can use all available template filters, tags and variables in your crumb titles.\r\n\r\nOptionally a crumb entry can be a tuple containing the title and callable\r\nfunction : ::\r\n\r\n 'documents-private-doc': (ugettext_lazy('Sitemap'), lambda x,y: True),\r\n\r\nThe callable function is given two arguments, the url name and the Request\r\nobject. The callable must return a boolean, ``True`` if the crumb can be\r\ndisplayed or ``False`` if the crumb must be ignored.\r\n\r\nThis form is generally used to check permission for private views, like this : ::\r\n\r\n def check_crumb_perm(name, request):\r\n if name == 'documents-private-doc' and request.user.is_anonymous():\r\n return False\r\n return True\r\n\r\n AUTOBREADCRUMBS_TITLES = {\r\n ...\r\n 'documents-private-doc': (ugettext_lazy('Sitemap'), lambda x,y: True),\r\n ...\r\n }\r\n\r\nApp crumbs\r\n~~~~~~~~~~\r\n\r\nApplications should define their crumbs in a ``crumbs.py`` file like this :\r\n\r\n::\r\n\r\n from autobreadcrumbs import site\r\n from django.utils.translation import ugettext_lazy\r\n\r\n site.update({\r\n ...\r\n 'documents-index': ugettext_lazy('Sitemap'),\r\n ...\r\n })\r\n\r\nNote the usage of ``ugettext_lazy`` to get translated strings, if you don't use the `Django internationalization system`_ in your\r\nproject you can avoid it, but if you plan to use it you must apply ``ugettext_lazy`` on your title strings.\r\n\r\nProject crumbs\r\n~~~~~~~~~~~~~~\r\n\r\nAlso you can register crumbs in your project settings :\r\n\r\n::\r\n\r\n AUTOBREADCRUMBS_TITLES = {\r\n \"pages-index1\": u\"My index\",\r\n \"pages-index2\": u\"My index alternative\",\r\n }\r\n\r\nCrumbs setted in project settings have the higher priority on application crumbs. As for `App crumbs`_ you should use\r\n``ugettext_lazy`` on your title strings.\r\n\r\nCrumbs with URL namespace\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nIf you use URL namespace on some views, remember to prefixed their crumb's url name with the namespace followed by a colon character, like this : ::\r\n\r\n AUTOBREADCRUMBS_TITLES = {\r\n ...\r\n \"mynamespace:pages-index1\": u\"My index\",\r\n ...\r\n }\r\n\r\nIf you forget to do this, your crumb won't be finded or be filled with a wrong crumb (from an another app view with the same url name but without the namespace).\r\n\r\n\r\nTemplate context\r\n****************\r\n\r\nIn all your templates laying that have the global context, two additional variables (`autobreadcrumbs_elements`_ and\r\n`autobreadcrumbs_current`_) will be added by the *context processor*.\r\n\r\nautobreadcrumbs_elements\r\n------------------------\r\n\r\nThis variable will contain the breadcrumb as a list of crumbs in the correct order, where each crumb will be\r\na ``BreadcrumbRessource`` instance. A ``BreadcrumbRessource`` instance contains the following attributes :\r\n\r\n* ``path`` : relative path to the ressource URL;\r\n* ``name`` : the ressource name (that is the name of the URL linked to the ressource), prefixed with the namespace if any;\r\n* ``title`` : the ressource title to be displayed;\r\n* ``view_args`` : argument list given to the ressource view;\r\n* ``view_kwargs`` : named argument list given to the ressource view;\r\n\r\nautobreadcrumbs_current\r\n-----------------------\r\n\r\nThis variable will contains the ``BreadcrumbRessource`` instance of the current crumb, this instance is the same as\r\nthe last list item in the `autobreadcrumbs_elements`_.\r\n\r\nTemplate tags\r\n*************\r\n\r\nThese tags are avalaible after loading their library in your templates : ::\r\n\r\n {% load autobreadcrumb %}\r\n\r\ncurrent_title_from_breadcrumbs\r\n This simply returns the title from the current ressource.\r\nautobreadcrumbs_tag\r\n Builds the breadcrumb HTML using the ``autobreadcrumbs_tag.html`` template.\r\nautobreadcrumbs_links\r\n Builds the breadcrumb HTML using the template strings in ``settings.AUTOBREADCRUMBS_HTML_LINK`` and\r\n ``settings.AUTOBREADCRUMBS_HTML_SEPARATOR``.\r\ncurrentwalkthroughto\r\n Returns the content tag if the current ressource walk through the given ressource URL name.\r\n\r\n Example : ::\r\n\r\n {% currentwalkthroughto 'index' %}This pas walk through the named url 'index'{% endcurrentwalkthroughto %}\r\n\r\n If the test fail, the tag return an empty string.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/autobreadcrumbs", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "autobreadcrumbs", "package_url": "https://pypi.org/project/autobreadcrumbs/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/autobreadcrumbs/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/autobreadcrumbs" }, "release_url": "https://pypi.org/project/autobreadcrumbs/2.0.0/", "requires_dist": null, "requires_python": null, "summary": "Django application to add breadcrumbs to your pages", "version": "2.0.0" }, "last_serial": 2287297, "releases": { "0.8.1": [ { "comment_text": "", "digests": { "md5": "a6505e6494b3ac76b07f78bb43ba3b37", "sha256": "6a67c3d6a669d27012d7859842392764eb2ff151b630ebbc0a6f9ac68c951646" }, "downloads": -1, "filename": "autobreadcrumbs-0.8.1.tar.gz", "has_sig": false, "md5_digest": "a6505e6494b3ac76b07f78bb43ba3b37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11112, "upload_time": "2012-05-05T16:17:52", "url": "https://files.pythonhosted.org/packages/d6/a9/6cb6b4fe55db548a59ba8cdffdd13b7f0e632b6341080bc67522e67ce97a/autobreadcrumbs-0.8.1.tar.gz" } ], "0.8.1.1": [ { "comment_text": "", "digests": { "md5": "a70aa8fdb01a19ff09bca70b8b24f55a", "sha256": "83ac6f406f4c849f7ff06e100b0e2355c7f5658a5696689b5bf55569eba2f7eb" }, "downloads": -1, "filename": "autobreadcrumbs-0.8.1.1.tar.gz", "has_sig": false, "md5_digest": "a70aa8fdb01a19ff09bca70b8b24f55a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11676, "upload_time": "2012-11-03T15:59:38", "url": "https://files.pythonhosted.org/packages/ea/38/41683cb926f3a5e59272aff3e7f3a8a053e5e019ffb130b97d0875d0b6ba/autobreadcrumbs-0.8.1.1.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "ee440b0f98a1eb8a2ca740993cd8a4a3", "sha256": "b696d1de8fccdc5ad83bba37f9c1b06d4d894acc313a513248f28e872c3e332f" }, "downloads": -1, "filename": "autobreadcrumbs-0.9.0.tar.gz", "has_sig": false, "md5_digest": "ee440b0f98a1eb8a2ca740993cd8a4a3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11973, "upload_time": "2014-01-26T21:16:53", "url": "https://files.pythonhosted.org/packages/04/54/5835b71d4b663745226f7f0081fb3a10fcabe98e6478cf3a384aa2dce9ca/autobreadcrumbs-0.9.0.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "63761fbbdbb836a10e393d540dc4c726", "sha256": "d5a8e59e5bfce4a8bdd61a22b7c860b149c893906a10e8ae6374c3f3b11c6e5b" }, "downloads": -1, "filename": "autobreadcrumbs-0.9.1.tar.gz", "has_sig": false, "md5_digest": "63761fbbdbb836a10e393d540dc4c726", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11973, "upload_time": "2014-01-27T11:16:45", "url": "https://files.pythonhosted.org/packages/3e/e8/540f881c0e497c42bf8f023fe547e4a800ff70158880ceb59385621e125f/autobreadcrumbs-0.9.1.tar.gz" } ], "0.9.1.1": [ { "comment_text": "", "digests": { "md5": "b264aeb8f89c423e5c12d98823726589", "sha256": "b3a966c72e00fda2419f03778c8cb5d2d63bea918c40a6f62fc2c5f253e38b07" }, "downloads": -1, "filename": "autobreadcrumbs-0.9.1.1.tar.gz", "has_sig": false, "md5_digest": "b264aeb8f89c423e5c12d98823726589", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12054, "upload_time": "2014-01-29T00:21:05", "url": "https://files.pythonhosted.org/packages/f4/f2/2d8dee4a8f0c1e5acc9475f591f35e49ddbbff94c8ba8cfc98a3bacd0d92/autobreadcrumbs-0.9.1.1.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "8c75200c14cf1df59b3ec27b09145cb1", "sha256": "3c0c40e3bf4ff8d1f39c6a1e11bd80aaa5f8aca8b37ec551391a7c0385140e77" }, "downloads": -1, "filename": "autobreadcrumbs-1.0.tar.gz", "has_sig": false, "md5_digest": "8c75200c14cf1df59b3ec27b09145cb1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12493, "upload_time": "2014-08-12T00:26:30", "url": "https://files.pythonhosted.org/packages/eb/43/23969b9d650901c923da207f736d9c73a5cecf90ae0b0640404fe7d5f030/autobreadcrumbs-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "7d56efba990b9d1637df60b5a17a4586", "sha256": "30e5703057554883df82827a8e0e0078c5bd2a024231ec5e75aa9179e47d5dd2" }, "downloads": -1, "filename": "autobreadcrumbs-1.1.tar.gz", "has_sig": false, "md5_digest": "7d56efba990b9d1637df60b5a17a4586", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10617, "upload_time": "2015-08-18T11:46:26", "url": "https://files.pythonhosted.org/packages/af/1a/752af62f59cdaf670904b1b0f52d889f97b415aa9e5ed502ba0627030a95/autobreadcrumbs-1.1.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "ca86c407677b1bbd10e8cba390895de7", "sha256": "68b0dfec94f4fd8415a5d5e9e34611a3950a787731b237c2390dfabfb145dc19" }, "downloads": -1, "filename": "autobreadcrumbs-2.0.0.tar.gz", "has_sig": false, "md5_digest": "ca86c407677b1bbd10e8cba390895de7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12643, "upload_time": "2016-08-17T22:58:51", "url": "https://files.pythonhosted.org/packages/4a/16/583b43d83e7ea7a9345ec3151d33462619bc52eed07978cac787a05bc3e1/autobreadcrumbs-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ca86c407677b1bbd10e8cba390895de7", "sha256": "68b0dfec94f4fd8415a5d5e9e34611a3950a787731b237c2390dfabfb145dc19" }, "downloads": -1, "filename": "autobreadcrumbs-2.0.0.tar.gz", "has_sig": false, "md5_digest": "ca86c407677b1bbd10e8cba390895de7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12643, "upload_time": "2016-08-17T22:58:51", "url": "https://files.pythonhosted.org/packages/4a/16/583b43d83e7ea7a9345ec3151d33462619bc52eed07978cac787a05bc3e1/autobreadcrumbs-2.0.0.tar.gz" } ] }