{ "info": { "author": "Carl M. Johnson", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# django-context-variables\nSimple utility to help make declarative class-based views in Django\n\n\nEach method on a CBV decorated with `context_variable` is evaluated once\nper instance (==request) by the `get_context_variables` function and added\nto the template's context.\n\n\n##Usage\nviews.py:\n\n class MyCBV(TemplateView):\n template_name = \"my_template.html\"\n\n def get_context_data(self, **kwargs):\n return get_context_variables(self)\n\n @context_variable\n def page(self):\n return get_object_or_404(MyModel, self.kwargs.get('page_id'))\n\n @context_variable\n def page_title(self):\n return '%s - My Site' % self.page.title\n\nmy_template.html:\n\n \n {{ page_title }}\n \n {{ page.content }}\n \n ", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/carlmjohnson/django-context-variables", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-context-variables", "package_url": "https://pypi.org/project/django-context-variables/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-context-variables/", "project_urls": { "Homepage": "https://github.com/carlmjohnson/django-context-variables" }, "release_url": "https://pypi.org/project/django-context-variables/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Simple utility to help make declarative class-based views in Django", "version": "0.0.3" }, "last_serial": 1744615, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "4f2f6a87216220acbb64b318273cd390", "sha256": "8e31d15f92a3a8f3e6b1892c4b0fe20fdb12bc681fe0689b1fc5acccf6d3fa48" }, "downloads": -1, "filename": "django_context_variables-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4f2f6a87216220acbb64b318273cd390", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 3784, "upload_time": "2015-09-29T20:24:47", "url": "https://files.pythonhosted.org/packages/d1/0f/4e7706492c118ce38c7f13123a5077eb820f31e13f97253526d858763f2f/django_context_variables-0.0.3-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4f2f6a87216220acbb64b318273cd390", "sha256": "8e31d15f92a3a8f3e6b1892c4b0fe20fdb12bc681fe0689b1fc5acccf6d3fa48" }, "downloads": -1, "filename": "django_context_variables-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4f2f6a87216220acbb64b318273cd390", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 3784, "upload_time": "2015-09-29T20:24:47", "url": "https://files.pythonhosted.org/packages/d1/0f/4e7706492c118ce38c7f13123a5077eb820f31e13f97253526d858763f2f/django_context_variables-0.0.3-py2.py3-none-any.whl" } ] }