{ "info": { "author": "Agendaless Consulting", "author_email": "repoze-dev@lists.repoze.org", "bugtrack_url": null, "classifiers": [ "Framework :: BFG", "Intended Audience :: Developers", "Programming Language :: Python" ], "description": "repoze.bfg.viewgroup\n====================\n\n``repoze.bfg.viewgroup`` is an extension for ``repoze.bfg`` which\nmakes it possible to make a ``bfg:viewgroup`` declaration in ZCML\nwhich acts much like ``bfg:view`` inasmuch as it results in a bfg view\nregistration. Unlike a \"normal\" ``bfg:view`` registration, however, a\n``bfg:viewgroup`` registration refers to one or more other bfg views\n(matching them by name, ``for`` interface, and request type). When a\n``bfg:viewgroup`` is invoked (either via traversal or via programmatic\nview execution), a viewgroup will return a response which appends all\nthe referenced view renderings together in a single body.\n\nThis package is largely by request for folks that enjoy using Zope 3\n\"content providers\" and \"viewlets\", although it is slightly less\nfeatureful, as bfg views themselves typically do not possess an\ninterface (they're just callables), so you cannot register a viewgroup\nagainst a view interface.\n\nNote that the author of ``repoze.viewgroup`` disagrees with the\nconcept on which its based; it seems more straightforward and\nunderstandable to him to just do the work in a view itself without all\nthis stupid machinery (the docs for this are particularly painful to\nwrite because they're entirely self-referential, a sure sign of stupid\nmachinery, so forgive me if I have trouble explaining it). This is\nlargely just a proof of concept, although a tested and functional one.\n\nInstallation\n------------\n\nInstall using setuptools, e.g. (within a virtualenv)::\n\n $ easy_install -i http://dist.repoze.org/lemonade/dev/simple \\\n repoze.bfg.viewgroup\n\nUsage\n-----\n\nTo use a viewgroup, you must:\n\n#. Create a ZCML registration which registers a viewgroup.\n\n#. Either invoke the viewgroup via normal URL traversal like a regular\n view - OR - use the ``provider`` API to inject content into your\n template using the viewgroup name.\n\nZCML Registration\n+++++++++++++++++\n\nCreate a ``bfg:viewgroup`` registration in ZCML via the\n``bfg:viewgroup`` directive::\n\n \n\nThe consituent attributes of this directive are:\n\n``name`` -- The name by which the viewgroup can be found via traversal\n or programmatic view execution. This attribute has the same meaning\n as the ``name`` attribute in a ``bfg:view`` directive.\n\n``viewnames`` -- The view names (in render order) which will be\n rendered when this viewgroup is rendered, separated by spaces. Each\n name should refer to a view name defined elsewhere in ZCML.\n\n``for`` -- The \"model\" interface which this view is registered for\n This attribute has the same meaning as its counterpart in\n ``bfg:view`` directive.\n\nThe ``for`` argument is optional; it defaults to ``None``. The\n``name`` argument is also optional. It defaults to the empty string\n(indicating the default view).\n\nViewgroups registered wih a ``name`` and a ``for`` and will conflict\nwith views registered with the same arguments, so it's wise to name\nyour viewgroups differently than your views.\n\nA viewgroup can refer to another viewgroup in its ``viewname``\nargument as necessary (although this is insane).\n\nWhat Happens When a Viewgroup is Rendered\n+++++++++++++++++++++++++++++++++++++++++\n\nWhen a viewgroup is rendered, it attempts to render each constituent\nview it references (via ``viewnames``). If an individual constituent\nview cannot be rendered due to a permission issue, it is skipped over.\nIf a constituent view cannot be rendered because it cannot be found, a\n``ValueError`` is raised. The rendering of a viewgroup is the simple\nconcatenation of all allowed views referenced by the viewgroup.\n\nProvider Helper\n+++++++++++++++\n\nA helper class named ``repoze.bfg.viewgroup.group.Provider`` is made\navailable for those wishing to render viewgroups within templates. An\ninstance of ``Provider`` can be constructed and passed into a template\nrendering so it may be used ala the ``provider:`` expression type in\nZope 3. For example, this view might render a template::\n\n from repoze.bfg.view import bfg_view\n\n @bfg_view(template='templates/mytemplate.pt')\n def myview(context, request):\n from repoze.bfg.viewgroup.group import Provider\n provider = Provider(context, request)\n return {'provider':provider}\n\nThe template being rendered can use the provider to \"fill slots\" by\npassing in view or viewgroup names as necessary, e.g.::\n\n \n \n \n \n Hello!\n \n\nThe names passed in to a provider should be either a bfg view name or\na bfg viewgroup name.\n\nReporting Bugs / Development Versions\n-------------------------------------\n\nVisit http://bugs.repoze.org to report bugs. Visit\nhttp://svn.repoze.org to download development or tagged versions.\n\n\nChanges\n=======\n\n0.3 (2010-06-15)\n----------------\n\n- Make compatible with BFG 1.2; first PyPI release.\n\n0.2\n---\n\n- Changes to support upcoming BFG release (which does not require\n zope.security, so we don't either).\n\n0.1\n---\n\n- Initial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.repoze.org", "keywords": "web wsgi zope content provider", "license": "BSD-derived (http://www.repoze.org/LICENSE.txt)", "maintainer": null, "maintainer_email": null, "name": "repoze.bfg.viewgroup", "package_url": "https://pypi.org/project/repoze.bfg.viewgroup/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/repoze.bfg.viewgroup/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.repoze.org" }, "release_url": "https://pypi.org/project/repoze.bfg.viewgroup/0.3/", "requires_dist": null, "requires_python": null, "summary": "An anlologue of Zope 3 \"content providers\" for repoze.bfg", "version": "0.3" }, "last_serial": 798801, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "01c861a2877f61ee65909219ea81baba", "sha256": "401439ca6545e29e71b8e0be537fa0f22581ac24f149bd719bed558fdd25de59" }, "downloads": -1, "filename": "repoze.bfg.viewgroup-0.3.tar.gz", "has_sig": false, "md5_digest": "01c861a2877f61ee65909219ea81baba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8187, "upload_time": "2010-06-15T19:43:01", "url": "https://files.pythonhosted.org/packages/cc/58/e46f5acd0f36b9ab8974db00ad85e738463d58216ad50bd41f45bd2fd5d9/repoze.bfg.viewgroup-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "01c861a2877f61ee65909219ea81baba", "sha256": "401439ca6545e29e71b8e0be537fa0f22581ac24f149bd719bed558fdd25de59" }, "downloads": -1, "filename": "repoze.bfg.viewgroup-0.3.tar.gz", "has_sig": false, "md5_digest": "01c861a2877f61ee65909219ea81baba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8187, "upload_time": "2010-06-15T19:43:01", "url": "https://files.pythonhosted.org/packages/cc/58/e46f5acd0f36b9ab8974db00ad85e738463d58216ad50bd41f45bd2fd5d9/repoze.bfg.viewgroup-0.3.tar.gz" } ] }