{ "info": { "author": "Cody Soyland", "author_email": "codysoyland@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "=====================\ndjango-smart-load-tag\n=====================\n\nAn attempt to bring namespaces and more control to Django's ``{% load %}`` tag.\n\nThis project includes two tags: ``{% import %}`` and a replacement for the built-in ``{% load %}``. Both provide a similar feature set. The primary difference is that ``{% import %}`` namespaces by default, where ``{% load %}`` does not, retaining backwards compatibility with Django's built-in ``{% load %}`` tag.\n\ninstallation\n============\n\nTo install, first install the package to your system using either of the following::\n\n pip install django-smart-load-tag\n easy_install django-smart-load-tag\n\nThen you must install into your Django project by adding \"smart_load_tag\" to your settings.INSTALLED_APPS.\n\nIf you want to use django-smart-load-tag without loading it into every template, you can install it globally by adding it to your builtin tags. Just add the following to your urlconf (usually urls.py)::\n\n from django.template import add_to_builtins\n add_to_builtins('smart_load_tag.templatetags.smart_load')\n\nintroduction\n============\n\nAfter loading, the smart ``{% load %}`` tag replaces the existing load tag, as it is backwards-compatible. It provides features that the existing load tag lacks:\n\ntemplatetag namespaces:\n-----------------------\n\n::\n\n {% load my_tags into cool_tags %} # Load library ``my_tags`` into namespace ``cool_tags``.\n {% cool_tags.my_tag %} # Usage of tag ``my_tag`` imported above as part of the template library ``my_tags``.\n\nload only a single tag from a library:\n--------------------------------------\n\n::\n\n {% load lib.tag_name %} # Load tag ``tag_name`` from templatetag library ``lib``.\n {% tag_name %} # Usage of tag imported above.\n\nload library from a specific application:\n-----------------------------------------\n\n::\n\n {% load lib from my_app %} # Ensure that library is loaded from my_app (by default, this will load the last library of that name in all your INSTALLED_APPS).\n\nload tag as different name\n--------------------------\n\n::\n\n {% load my_tags.foo_tag as my_foo_tag %} # Load tag ``foo_tag`` from library ``my_tags`` and assign to name ``my_foo_tag``\n {% my_foo_tag %} # Usage of tag imported above.\n\nThus, the syntax for the tag is described by this psuedo-regex:\n\n::\n\n {% load (lib_name(.tag_name)?( from app)?( as name)?( into namespace)?,? )+ %}\n\nexamples\n========\n\nAny combination of ``from``, ``as``, and ``into`` clauses are acceptable:\n\n::\n\n {% load foo_tags.my_tag from my_app into cool_tags as my_cool_tag %} # lib foo_tags, tag my_tag, app my_app, namespace cool_tags, name my_cool_tag\n {% cool_tags.my_cool_tag %} # Usage\n\nNote that the combination of ``into`` and ``as`` are not needed, as the following two lines are equivalent:\n\n::\n\n {% load foo_tags.my_tag into cool_tags as my_cool_tag %}\n {% load foo_tags.my_tag as cool_tags.my_cool_tag %}\n\nMultiple loads can be on the same line, optionally comma separated, enabling more complex combinations such as this:\n\n::\n\n {% load foo_tags from app1 into app1_foo_tags, foo_tags from app2, bar_tags.render_content as render_bar_content %}\n {% app1_foo_tags.render_content %} # from ``foo_tags from app1 into app1_foo_tags``\n {% render_content %} # from ``foo_tags from app2``\n {% render_bar_content %} # from ``bar_tags.render_content as render_bar_content``\n\nThe functionality provided by django-smart-load-tag is a progressive enhancement, and can be safely loaded into any template, as it remains backwards-compatible with Django's built-in ``{% load %}`` tag.\n\nalternative syntax\n==================\n\nThe ``{% load %}`` replacement is intended to be backwards compatible, but a new tag also exists, ``{% import %}`` that provides a syntax that defaults to providing a namespace, while allowing you to opt-out of namespacing the loaded tags (using ``* from``).\n\nThe following table illustrates the differences in syntax from the smart ``{% load %}`` tag.\n\n ============================================ =================================================\n {% import %} syntax {% load %} syntax\n ============================================ =================================================\n {% import foo_tags %} {% load foo_tags into foo_tags %}\n {% import foo_tags from app1 %} {% load foo_tags from app1 into foo_tags %}\n {% import foo_tags.my_tag %} {% load foo_tags.my_tag as foo_tags.my_tag %}\n {% import foo_tags from my_app as my_foo %} {% load foo_tags from my_app into my_foo %}\n {% import foo_tags.my_tag as my_foo_tag %} {% load foo_tags.my_tag as my_foo_tag %}\n {% import * from foo_tags %} {% load foo_tags %}\n {% import * from foo_tags from app1 %} {% load foo_tags from app1 %}\n ============================================ =================================================", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/codysoyland/django-smart-load-tag", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-smart-load-tag", "package_url": "https://pypi.org/project/django-smart-load-tag/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-smart-load-tag/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/codysoyland/django-smart-load-tag" }, "release_url": "https://pypi.org/project/django-smart-load-tag/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "An attempt to bring namespaces and more control to Django's {% load %} tag.", "version": "0.3.2" }, "last_serial": 790674, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "b11fb46f862e00475a47bd62f043703d", "sha256": "52f1846556973971ef3998b09237b1860c0a56fa233065bdf3d2040fb2cdcc19" }, "downloads": -1, "filename": "django-smart-load-tag-0.2.tar.gz", "has_sig": false, "md5_digest": "b11fb46f862e00475a47bd62f043703d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3366, "upload_time": "2010-08-07T23:58:34", "url": "https://files.pythonhosted.org/packages/c1/0d/b154262f4334669d5fe60a2fd96ac6cbd69ef7ac9f8dbb8cf42cf067369f/django-smart-load-tag-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "2a017030530b8600349df7c0e4b4a84e", "sha256": "4f13b2cf64cf08d05f9720e6ad9086b0ff917de0fb1896568a0cbdc2c7b00495" }, "downloads": -1, "filename": "django-smart-load-tag-0.3.tar.gz", "has_sig": false, "md5_digest": "2a017030530b8600349df7c0e4b4a84e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3975, "upload_time": "2010-08-10T02:33:21", "url": "https://files.pythonhosted.org/packages/f1/71/eaeb458adccdee1edd1699832bdc83bb771fd4071880c57ccee0d015adf0/django-smart-load-tag-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "3f5c26a874fe7a6a8d858aceb7206095", "sha256": "5527a33adf19497eb4bb6302c931ec2bb6fe480c2ee8d057507bb8a15bc0fd64" }, "downloads": -1, "filename": "django-smart-load-tag-0.3.1.tar.gz", "has_sig": false, "md5_digest": "3f5c26a874fe7a6a8d858aceb7206095", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7386, "upload_time": "2011-05-23T21:42:59", "url": "https://files.pythonhosted.org/packages/a5/d0/12fabd686b6e5d1a93b056e9b0b376b390ebc713d0048b68b3f4c051c5e9/django-smart-load-tag-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "9c810576afc3bc371dfe66101f4fdcad", "sha256": "7a38c7127fb2501e6dbde165daf5bcac990e35f1567d043992618c95abfceef6" }, "downloads": -1, "filename": "django-smart-load-tag-0.3.2.tar.gz", "has_sig": false, "md5_digest": "9c810576afc3bc371dfe66101f4fdcad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7992, "upload_time": "2012-01-09T18:13:07", "url": "https://files.pythonhosted.org/packages/a7/f4/8f0d1b093a56f8b35fc0135214bad225cb51db28762e7ad7646bffccca39/django-smart-load-tag-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9c810576afc3bc371dfe66101f4fdcad", "sha256": "7a38c7127fb2501e6dbde165daf5bcac990e35f1567d043992618c95abfceef6" }, "downloads": -1, "filename": "django-smart-load-tag-0.3.2.tar.gz", "has_sig": false, "md5_digest": "9c810576afc3bc371dfe66101f4fdcad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7992, "upload_time": "2012-01-09T18:13:07", "url": "https://files.pythonhosted.org/packages/a7/f4/8f0d1b093a56f8b35fc0135214bad225cb51db28762e7ad7646bffccca39/django-smart-load-tag-0.3.2.tar.gz" } ] }