{ "info": { "author": "Benjamin Roth", "author_email": "brstgt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-subview\n==============\n\ndjango_subview is a module to include complete views with application logic into templates\nand to retrieve them by a single, generic url.\n\nWhat is this for?\n-----------------\n\nIn the AJAX world, there are often parts in a page, that contain an own, self-contained and reusable application logic.\nCall it pagelet, portlet, partial, subcontroller, ... we call it subview,\ncorresponding to Djangos Model/View/Template structure.\nThis is because it is just a normal view that is included into the response of another view.\n\nExample use case:\nImagine the frontpage of a blog page. A module with the latest 5 comments should reload every minute.\n1. This module should be included in the frontpage\n2. It has to be rendered \"standalone\" for an AJAX request\n\nInclude view in template\n------------------------\nA view can simply included in a template as shown below.\n\n {% subview \"path.to.some_view\" name1=value1 name2=value2 %}\n\nThe first argument is a path to a view. It can be an absolute Python path\nor just ``app_name.view_name`` without the project name if the view is\nlocated inside the project.\n\nView parameters are space-separated values that are passed to the view function.\nOnly keyword arguments are supported. All arguments for the view should be present or have default values.\n\nFor example if you have a view ``app_name.latestcomments`` taking client's id and\nthe view has the following signature:\n\n def latestcomments(request, amount):\n\nthen in a template you can call the subview for a certain client like this::\n\n {% subview \"app_name.latestcomments\" amount=5 %}\n\nCall view with generic URL\n--------------------------\n\n### What is this for? ###\n\nOften, subviews are reusable, self contained components and are not intended to be opened standalone in a browser.\nSo you don't have to define a url for each view but can access it from your ajax app through a generic URL.\n\n### Example ###\n\nYou have to include the bundled urlpatterns in your root urlconf like this:\n\n urlpatterns = patterns('',\n url(r'^subview', include('subview.urls')),\n )\n\nNow you simply can request a view from your browser like:\n\n http://127.0.0.1:8000/subview/myapp.views.latestcomments/{\"amount\":\"5\"}?some=parameter\n\nPlease bear in mind that this excample is not urlencoded for readability. The real request should look like:\n\n http://127.0.0.1:8000/subview/myapp.views.latestcomments/%7B\"amount\":\"5\"%7D?some=parameter\n\nGET and POST parameters aren't affected in any way. This means you can use and access\nthem as usual from within your view / subview.", "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/brstgt", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-subview", "package_url": "https://pypi.org/project/django-subview/", "platform": "any", "project_url": "https://pypi.org/project/django-subview/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/brstgt" }, "release_url": "https://pypi.org/project/django-subview/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Treat Django views as reusable and generic components", "version": "0.1.2" }, "last_serial": 790796, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "29ba7d07081865c27b5ae3081acbe3c1", "sha256": "178e310588daf3e16e5fa9991ab40d64b00a205c3aa8d725b9991e9c4ecbb931" }, "downloads": -1, "filename": "django-subview-0.1.tar.gz", "has_sig": false, "md5_digest": "29ba7d07081865c27b5ae3081acbe3c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3880, "upload_time": "2012-02-25T13:30:50", "url": "https://files.pythonhosted.org/packages/14/88/ea85eddc327e33db146cfbbbf244dcd5b797a4af5d913408ba57d2d8d4d1/django-subview-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ec94cdd210b2346d7a06ac5fdc8e890a", "sha256": "2c63bdb721961001ada9428a294c127d49f0732117d0aa96cf423c2ea0665fab" }, "downloads": -1, "filename": "django-subview-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ec94cdd210b2346d7a06ac5fdc8e890a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2929, "upload_time": "2012-03-02T17:30:42", "url": "https://files.pythonhosted.org/packages/21/3b/a6df9bd742aa1c7bdda4fc9a0e1cff6c1f45d757c4a4eb76742c25614a73/django-subview-0.1.1.tar.gz" } ], "0.1.1a": [ { "comment_text": "", "digests": { "md5": "c515d5bdc298b06d5a3c4a9531f04bd5", "sha256": "dde34a2e1751bc8ada90b7ec4e0f31dea1ab2f395063c63706b54659ea483011" }, "downloads": -1, "filename": "django-subview-0.1.1a.tar.gz", "has_sig": false, "md5_digest": "c515d5bdc298b06d5a3c4a9531f04bd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3906, "upload_time": "2012-03-12T15:19:20", "url": "https://files.pythonhosted.org/packages/ac/a2/bb91a05f99bfe63f5cf31bb0af3316f596fbd6f259d0ce455d828edf0abc/django-subview-0.1.1a.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "4fe05a2193b48bed7985786ca11a61c2", "sha256": "50e1c7f645307213c7acd5a1621f1d6ee84c4a1769fcc4b6f78b05be66071870" }, "downloads": -1, "filename": "django-subview-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4fe05a2193b48bed7985786ca11a61c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3904, "upload_time": "2012-03-12T15:22:08", "url": "https://files.pythonhosted.org/packages/9b/b3/a0aafabf3d33c8e193e8fdcd84d1ee4b39e455a356e787dac90eb888888d/django-subview-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4fe05a2193b48bed7985786ca11a61c2", "sha256": "50e1c7f645307213c7acd5a1621f1d6ee84c4a1769fcc4b6f78b05be66071870" }, "downloads": -1, "filename": "django-subview-0.1.2.tar.gz", "has_sig": false, "md5_digest": "4fe05a2193b48bed7985786ca11a61c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3904, "upload_time": "2012-03-12T15:22:08", "url": "https://files.pythonhosted.org/packages/9b/b3/a0aafabf3d33c8e193e8fdcd84d1ee4b39e455a356e787dac90eb888888d/django-subview-0.1.2.tar.gz" } ] }