{ "info": { "author": "Diego Lapiduz", "author_email": "diego@lapiduz.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "[![Build Status](https://travis-ci.org/dlapiduz/django-widgeter.png?branch=master)](https://travis-ci.org/dlapiduz/django-widgeter)\n\nWidgeter\n========================\n\nA simple engine for django backend widgets based on https://github.com/marcinn/django-widgets.\n\n\nFeatures\n-----------------\n\n- Creation of custom widgets in reusable apps\n- Rendering of widgets by name\n- Rendering of widget blocks without previous knowledge of widget names\n- Autodiscovery of widgets from all installed apps\n\n\nInstallation\n-----------------\n\n1. Install the package using `pip install django-widgeter`\n1. Add `widgeter` to your `INSTALLED_APPS` in `settings.py`\n\n\nDefining a Widget\n-----------------\n\nAdd a `widgets.py` file on your application with the following statements.\n\n- Widgets can be defined with a template (and optionally a context):\n ```\n from widgeter.base import Widget\n \n class HelloWorld(Widget):\n template = 'hello_world/widget.html'\n\n def get_context(self, context, options=None):\n return { 'message': u'Hello World!' }\n ```\n\n or with a render function:\n ```\n from widgeter.base import Widget\n \n class HelloWorld(Widget):\n def render(self, context, options=None):\n return u'Hello world!'\n\n ```\n- Register your widget:\n ```\n from widgeter.registry import registry\n\n registry.register('hello_world', HelloWorld())\n ```\n\n\nRendering a Widget\n-----------------\n\nOn a template you first have to load the template tags and then render the particular widget:\n\n```\n {% load widgeter %}\n {% widget \"hello_world\" %}\n```\n\nYou can also pass variables to your widget:\n\n```\n {% load widgeter %}\n {% widget \"hello_world\" current_user %}\n```\n\n\nUsing Blocks\n-----------------\n\nWidget blocks allow you to render widgets without previously knowing the names for them.\nThe autodiscovery process will add them to the registry and you can the look them up by block name.\nPriorities can also be assigned to render them in order.\n\n- First define a block on the widget:\n ```\n from widgeter.base import Widget\n \n class HelloWorld(Widget):\n block = 'home'\n priority = '1'\n template = 'hello_world/widget.html'\n\n def get_context(self, context, options=None):\n return { 'message': u'Hello World!' }\n ```\n\n- Then, on the template, use the `widget_block` tag:\n ```\n {% load widgeter %}\n {% widget_block \"home\" current_user %}\n ```\n\nRunning the Tests\n------------------------------------\n\nYou can run the tests with via::\n\n python setup.py test\n\nor::\n\n python runtests.py", "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/dlapiduz/django-widgeter", "keywords": null, "license": "Public Domain", "maintainer": null, "maintainer_email": null, "name": "django-widgeter", "package_url": "https://pypi.org/project/django-widgeter/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-widgeter/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/dlapiduz/django-widgeter" }, "release_url": "https://pypi.org/project/django-widgeter/0.1/", "requires_dist": null, "requires_python": null, "summary": "Widgeter: A simple engine for backend widgets", "version": "0.1" }, "last_serial": 841594, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d549f52f302c7a76325836a445e393c0", "sha256": "607ebe7b5adccd7f18f2b560bf1d1340b78324a3ad879817649b13a793258ac8" }, "downloads": -1, "filename": "django-widgeter-0.1.tar.gz", "has_sig": false, "md5_digest": "d549f52f302c7a76325836a445e393c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4200, "upload_time": "2013-08-16T15:08:14", "url": "https://files.pythonhosted.org/packages/a8/06/d1cceb86d5292a9ef70a28d68e5d864fe5062e6939ac1c070cfd33a216ba/django-widgeter-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d549f52f302c7a76325836a445e393c0", "sha256": "607ebe7b5adccd7f18f2b560bf1d1340b78324a3ad879817649b13a793258ac8" }, "downloads": -1, "filename": "django-widgeter-0.1.tar.gz", "has_sig": false, "md5_digest": "d549f52f302c7a76325836a445e393c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4200, "upload_time": "2013-08-16T15:08:14", "url": "https://files.pythonhosted.org/packages/a8/06/d1cceb86d5292a9ef70a28d68e5d864fe5062e6939ac1c070cfd33a216ba/django-widgeter-0.1.tar.gz" } ] }