{ "info": { "author": "iamsk", "author_email": "iamsk.info@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "django-webnodes\n===============\n\nThe goal of `django-webnodes` is to create a new way of writing django templates which is fully compatible with the current django templating infrastructure. \n\nIt's born to make it easy to support standard, reusable `bussiness components` across your application.\n\n`django-webnodes` are like special functional calls to render components of your page.\n\n## Usage:\n\nThis use as django templatetags\n\n\t{% webnode node_name [value1 value2 ... key1=value1 key2=value2 ...] %}\n\n- ``value1``: position value passed as ``value1`` in ``get_context()`` and ``render()`` methods\n- ``key1=value1``: dictionary key-value pairs passed as ``key1`` in ``get_context()`` and ``render()`` methods\n\n## Demo\n\nFor example, if you are implementing a app statistics website, and you want to have app ratings appear on both list page and detail page, you can make an `RatingsNode` to render them on both pages.\n\nFirst, create a Python module for your webnodes, e.g., webnodes.py(place it in ``yourapp`` module)\n\n from webnodes import WebNode\n\n\n class RatingsNode(WebNode):\n\n \ttemplate = 'webnodes/ratings.html'\n\n def get_context(self, app_id):\n \t...\n\t ratings = ...\n \t return {'ratings': ratings}\n\nCalling from template:\n\n {% load webnode %}\n\n

{% webnode RatingsNode app.id %}

\n\n## Extension\n\nIf you want see this webnode independently, you can add this in your urls' urlpatterns\n\n\turl(r'^webnodes/', include('webnodes.ext.urls'))\n\nThen open `http://127.0.0.1:8000/webnodes/RatingsNode?app_id=414603431` in your browser, you will see it.\n\n## Why use this?\n\n1. Decoupling the logic of front-end and back-end separately;\n2. Make each component as a webnode will improve cohesion(because each component's template and data(include the logic of fetch data) are always strongly correlated);\n3. We can test each component independently;\n4. easy to realize partial renewal.\n\n## Todos\n\nsupport css and javascript\n\n# Refs\n\nInspired by [tornado UI Module](https://github.com/facebook/tornado/blob/master/tornado/web.py), [django custom templatetags](https://docs.djangoproject.com/en/dev/howto/custom-template-tags/).\n\nBased on [django-widgets(1)](https://code.google.com/p/django-widgets) and [django-widgets(2)](https://github.com/marcinn/django-widgets)", "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/iamsk/django-webnodes", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-webnodes", "package_url": "https://pypi.org/project/django-webnodes/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-webnodes/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/iamsk/django-webnodes" }, "release_url": "https://pypi.org/project/django-webnodes/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Re-usable bussiness components, modular units on a page", "version": "0.0.3" }, "last_serial": 932302, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f78ade5f533c7834a0e55c2088b3f1b8", "sha256": "e03a595e54dde9ce503c09e35cbb53c8ab308ea2fd7c26a7fef4e55afa6fb76f" }, "downloads": -1, "filename": "django-webnodes-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f78ade5f533c7834a0e55c2088b3f1b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4093, "upload_time": "2013-11-30T05:46:11", "url": "https://files.pythonhosted.org/packages/8c/9e/5aee3e8907073c6918ef82a29c7aa8790aabe77ee57f2eb57e5cf4b4dbb1/django-webnodes-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "52cbb4d927e5bf4c992db7a0bfccdc11", "sha256": "aae8f0e3fc25586c80a6fb2b54997699827e1e7b22a8cda62fbe351bd51d7e3c" }, "downloads": -1, "filename": "django-webnodes-0.0.2.tar.gz", "has_sig": false, "md5_digest": "52cbb4d927e5bf4c992db7a0bfccdc11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4138, "upload_time": "2013-11-30T05:55:34", "url": "https://files.pythonhosted.org/packages/a8/6e/3556bc3a768d265623656204c0e4d58a92edd4382a8f0482719618011cb5/django-webnodes-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b8d2003d269a32e762f1dee5a0e60c9b", "sha256": "cb57623b9ddcdae451dd1c023db12e29c6e0b7b57f2ddedc2a1902c272b6a4f8" }, "downloads": -1, "filename": "django-webnodes-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b8d2003d269a32e762f1dee5a0e60c9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4382, "upload_time": "2013-11-30T06:01:15", "url": "https://files.pythonhosted.org/packages/39/e1/34d725fc3d4fbb2ca9f6cdd745f34c74774979e8fb7254f25b52fe2298e4/django-webnodes-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b8d2003d269a32e762f1dee5a0e60c9b", "sha256": "cb57623b9ddcdae451dd1c023db12e29c6e0b7b57f2ddedc2a1902c272b6a4f8" }, "downloads": -1, "filename": "django-webnodes-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b8d2003d269a32e762f1dee5a0e60c9b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4382, "upload_time": "2013-11-30T06:01:15", "url": "https://files.pythonhosted.org/packages/39/e1/34d725fc3d4fbb2ca9f6cdd745f34c74774979e8fb7254f25b52fe2298e4/django-webnodes-0.0.3.tar.gz" } ] }