{ "info": { "author": "Piotr Kilczuk", "author_email": "piotr@tymaszweb.pl", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "======================\ndjango-template-finder\n======================\n\n.. image:: https://travis-ci.org/TyMaszWeb/django-template-finder.svg?branch=master\n :target: https://travis-ci.org/TyMaszWeb/django-template-finder\n\ndjango-template-finder is a simple Django utility that allows you to find\ntemplates with names matching given pattern.\n\nSuppose you are writing an app and want to allow your user to choose one of\npredefined templates, but don't want to hardcode their names in any way. Scan\nfor files? What if they are not store in the same directory? This is where\ndjango-template-finder can help you!\n\nSupported template loaders:\n\n- ``django.template.loaders.app_directories.Loader``\n- ``django.template.loaders.filesystem.Loader``\n- ``django.template.loaders.cached.Loader``\n\nContributions and comments are welcome using Github at:\nhttp://github.com/TyMaszWeb/django-template-finder\n\nInstallation\n============\n\n#. `pip install django-template-finder`\n\nThat's it! It's just a simple utility library, no need to add anything to\n``INSTALLED_APPS``.\n\nYou will need a recent version of Django. Chances are django-template-finder\nwill work with Django 1.2+, however only versions above 1.3 are supported.\n\nUsage\n=====\n\nSearch for all ``404.html`` templates, recursively, in all template loaders:\n\n::\n\n from templatefinder import find_all_templates\n\n find_all_templates('404.html')\n\nSearch for all ``4xx.html`` templates, recursively, in all template loaders:\n\n::\n\n from templatefinder import find_all_templates\n\n find_all_templates('4*.html')\n\nSearch for all templates under ``menu/``, recursively, in all template loaders:\n\n::\n\n from templatefinder import find_all_templates\n\n find_all_templates('menu/*')\n\nGenerate nicer, human-friendly names for discovered templates in forms:\n\n::\n\n from templatefinder import find_all_templates, template_choices\n from django.forms.widgets import Select\n\n class MyForm(Form):\n def __init__(self, *args, **kwargs):\n super(MyForm, self).__init__(*args, **kwargs)\n found_templates = find_all_templates('menu/*')\n choices = template_choices(templates=found_templates, display_names=None)\n self.fields['myfield'].widget = Select(choices=list(choices))\n\nProviding human-friendly names for discovered templates, overriding the built-in\nname calculation:\n\n::\n\n from templatefinder import find_all_templates, template_choices\n\n found_templates = find_all_templates('menu/*')\n choices = template_choices(templates=found_templates, display_names={\n 'menu/menu.html': 'My super awesome menu',\n })\n\nUsing a project-wide setting for overriding the template display names:\n\n::\n\n from django.conf import settings\n # note: this should be in your Django project's settings module, and is\n # only set here for illustration purposes.\n settings.TEMPLATEFINDER_DISPLAY_NAMES = {\n 'menu/menu.html': 'Super menu',\n 'menu/another-menu.html': 'Another menu',\n }\n\n from templatefinder import find_all_templates, template_choices\n\n found_templates = find_all_templates('menu/*')\n choices = template_choices(found_templates)\n\nBugs & Contribution\n===================\n\nPlease use Github to report bugs, feature requests and submit your code:\nhttp://github.com/TyMaszWeb/django-template-finder\n\n:author: Piotr Kilczuk\n:date: 2013/03/27", "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/TyMaszWeb/django-template-finder", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-template-finder", "package_url": "https://pypi.org/project/django-template-finder/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-template-finder/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/TyMaszWeb/django-template-finder" }, "release_url": "https://pypi.org/project/django-template-finder/0.6.2/", "requires_dist": null, "requires_python": null, "summary": "Simple Django utility that allows you to find templates with names matching given pattern", "version": "0.6.2" }, "last_serial": 1397119, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "c6b77c9ce77e6074b09a7751b69d2f78", "sha256": "1af5161e9ab68cf1cec31951b1bf96ef953670f511a10b2d5366df847439b109" }, "downloads": -1, "filename": "django-template-finder-0.5.tar.gz", "has_sig": false, "md5_digest": "c6b77c9ce77e6074b09a7751b69d2f78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4256, "upload_time": "2013-06-18T18:22:41", "url": "https://files.pythonhosted.org/packages/df/94/e31bba3f2daad274b85a0e791c531d9372a8906a366525108d924399a488/django-template-finder-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "862966cf3d498a645b3fc9747467f1e7", "sha256": "4bb98106118272b73c1730dd7d227c473ef8ce83b6c99456bcc06dca7dc8ff03" }, "downloads": -1, "filename": "django-template-finder-0.5.1.tar.gz", "has_sig": false, "md5_digest": "862966cf3d498a645b3fc9747467f1e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4404, "upload_time": "2014-07-25T06:14:08", "url": "https://files.pythonhosted.org/packages/8f/ff/ac9cdcbeb77288b0bde837ef0e54ad886ee8e3814f11a693a520abc850d1/django-template-finder-0.5.1.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "eaaf3c8356cc95d33f854a335e866045", "sha256": "6028548b6459c98f7a96094e2e0ca59a8902a9b2593a2842cf7933685561dbca" }, "downloads": -1, "filename": "django-template-finder-0.6.1.tar.gz", "has_sig": false, "md5_digest": "eaaf3c8356cc95d33f854a335e866045", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4506, "upload_time": "2015-01-26T11:44:33", "url": "https://files.pythonhosted.org/packages/c9/d9/6d061190fc5b73b5b7b51d3a4e8f9316d7290c5b9f54365faed8e26e0034/django-template-finder-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "98657ed009d686abcbaf145231b8ffdf", "sha256": "157bc0651e8965162e4ff8de6976d9613fc2df74f9baeab4945a0f5d60f2cf3e" }, "downloads": -1, "filename": "django-template-finder-0.6.2.tar.gz", "has_sig": false, "md5_digest": "98657ed009d686abcbaf145231b8ffdf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6264, "upload_time": "2015-01-26T17:26:23", "url": "https://files.pythonhosted.org/packages/31/13/a8de9beff6d5afe8cb09c5903109db68a18244b84ff0f3fb9620ef25cb6c/django-template-finder-0.6.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "98657ed009d686abcbaf145231b8ffdf", "sha256": "157bc0651e8965162e4ff8de6976d9613fc2df74f9baeab4945a0f5d60f2cf3e" }, "downloads": -1, "filename": "django-template-finder-0.6.2.tar.gz", "has_sig": false, "md5_digest": "98657ed009d686abcbaf145231b8ffdf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6264, "upload_time": "2015-01-26T17:26:23", "url": "https://files.pythonhosted.org/packages/31/13/a8de9beff6d5afe8cb09c5903109db68a18244b84ff0f3fb9620ef25cb6c/django-template-finder-0.6.2.tar.gz" } ] }