{ "info": { "author": "Iacopo Spalletti", "author_email": "i.spalletti@nephila.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "=================\ndjango-meta-mixin\n=================\n\n.. image:: https://img.shields.io/pypi/v/django-meta-mixin.svg?style=flat-square\n :target: https://pypi.python.org/pypi/django-meta-mixin\n :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/dm/django-meta-mixin.svg?style=flat-square\n :target: https://pypi.python.org/pypi/django-meta-mixin\n :alt: Monthly downloads\n\n.. image:: https://img.shields.io/pypi/pyversions/django-meta-mixin.svg?style=flat-square\n :target: https://pypi.python.org/pypi/django-meta-mixin\n :alt: Python versions\n\n.. image:: https://img.shields.io/travis/nephila/django-meta-mixin.svg?style=flat-square\n :target: https://travis-ci.org/nephila/django-meta-mixin\n :alt: Latest Travis CI build status\n\n.. image:: https://img.shields.io/coveralls/nephila/django-meta-mixin/master.svg?style=flat-square\n :target: https://coveralls.io/r/nephila/django-meta-mixin?branch=master\n :alt: Test coverage\n\n.. image:: https://img.shields.io/codecov/c/github/nephila/django-meta-mixin/master.svg?style=flat-square\n :target: https://codecov.io/github/nephila/django-meta-mixin\n :alt: Test coverage\n\n.. image:: https://codeclimate.com/github/nephila/django-meta-mixin/badges/gpa.svg?style=flat-square\n :target: https://codeclimate.com/github/nephila/django-meta-mixin\n :alt: Code Climate\n\nWarning\n-------\n\nVersion 0.2.1 is the last version ever of **django-meta-mixin**\n\nAll the codebase, features and documentation has been moved to\nhttps://github.com/nephila/django-meta and it will be released in\n**django-meta** 1.0.\n\n**django-meta** 1.0 is a drop-in replacement for **django-meta-mixin**: an empty\n**django-meta-mixin** 0.3 package will be released together with **django-meta-mixin**\nto satisfy dependencies but all the following features and fixes will be released\nin **django-meta**.\n\nConcepts\n--------\n\n**django-meta-mixin** provides a mixin to handle metadata in your models.\n\nActual data are evaluated at runtime pulling values from model attributes and\nmethods.\n\nTo use it, defines a ``_metadata`` attribute as a dictionary of tag/value pairs;\n\n* **tag** is the name of the metatag as used by ``meta.html`` template\n* **value** is a string that is evaluated in the following order:\n\n * model method name called with the meta attribute as argument\n * model method name called with no arguments\n * model attribute name (evaluated at runtime)\n * string literal (if none of the above exists)\n\nIf **value** is ``False`` or it is evaluated as ``False`` at runtime the tag is skipped.\n\nTo use this mixin you must invoke ``as_meta()`` on the model instance\nfor example in the get_context_data().\n\nRequest\n+++++++\n\n``as_meta()`` accepts the ``request`` object that is saved locally and is available to methods by\nusing the ``get_request`` method.\n\n\nPublic interface\n++++++++++++++++\n\n``ModelMeta.get_meta(request=None)``: returns the metadata attributes definition. Tipically these\nare set in ``_metadata`` attribute in the model;\n\n``ModelMeta.as_meta(request=None)``: returns the meta representation of the object suitable for\nuse in the template;\n\n``ModelMeta.get_request()``: returns the ``request`` object, if given as argument to ``as_meta``;\n\n``ModelMeta.get_author()``: returns the author object for the current instance. Default\nimplementation does not return a valid object, this **must** be overidden in the application\naccording to what is an author in the application domain;\n\n``ModelMeta.build_absolute_uri(url)``: create an absolute URL (i.e.: complete with protocol and\ndomain); this is generated from the ``request`` object, if given as argument to ``as_meta``;\n\n\nInstallation\n------------\n\nFrom PyPi::\n\n pip install django-meta-mixin\n\nFrom github::\n\n pip install -e git+https://github.com/nephila/django-meta-mixin#egg=django-meta-mixin\n\nUsage\n-----\n\n#. Add to installed apps along with ``django-meta``::\n\n INSTALLED_APPS = [\n ...\n 'meta',\n 'meta_mixin',\n ]\n\n#. Configure ``django-meta`` according to documentation\n (https://github.com/nephila/django-meta#configuration)\n\n#. Add meta information to your model::\n\n from django.db import models\n from meta_mixin.models import ModelMeta\n\n class MyModel(ModelMeta, models.Model):\n name = models.CharField(max_length=20)\n abstract = models.TextField()\n ...\n\n _metadata = {\n 'title': 'name',\n 'description': 'abstract',\n ...\n }\n\n#. Push metadata in the context using ``as_meta`` method::\n\n class MyView(DetailView):\n\n ...\n\n def get_context_data(self, **kwargs):\n context = super(MyView, self).get_context_data(self, **kwargs)\n context['meta'] = self.get_object().as_meta(self.request)\n return context\n\n#. Include ``meta_mixin/meta.html`` template in your templates::\n\n {% load sekizai_tags %}\n\n \n \n {% include \"meta_mixin/meta.html\" %}\n \n \n \n \n\nNote\n++++\nFor Google+ support you must add ``{% render_block 'html_extra' %}`` in your template to add object type definition. See relevant Google+ snippets documentation (https://developers.google.com/+/web/snippet/)\n\nExample\n+++++++\n\nLook at the ``example`` folder for a sample implementation.\n\nAvailable properties\n--------------------\n\n**django-meta-mixin** currently supports the following properties:\n\nGeneric properties\n++++++++++++++++++\n* title: object title,\n* description: generic object description, used for SEO and as default for specific description,\n* keywords: generic keywords for SEO\n* locale: advertised object locale (if any)\n* image: image to display for object\n* object_type: default object type\n* published_time: date-time of publishing\n* modified_time: date-time of modification\n* expiration_time: date-time of expiration\n* url: canonical object url\n\nOpen Graph properties\n+++++++++++++++++++++\n* og_description: object description in Open Graph\n* og_type: object type in Open Graph\n* og_app_id: Facebook App ID\n* og_profile_id: Author's Facebook profileID\n* og_publisher: Facebook URL to publisher's profile\n* og_author_url: Facebook URL to author's profile\n* tag: object tags\n\n\nTwitter Cards properties\n++++++++++++++++++++++++\n* twitter_description: object description on Twitter card (currently 200 chars max)\n* twitter_type: twitter card type\n* twitter_site: Website twitter account\n* twitter_author: Author twitter account\n\n\nGoogle+ Snippet properties\n++++++++++++++++++++++++++\n* gplus_description: object description\n* gplus_type: object type according to schema.org types\n* gplus_author: Author Google+ account\n\nObject types\n------------\n\n``django-meta-mixin`` ships with the following object types for each set of meta tags it supports:\n\nGeneric / OpenGraph\n+++++++++++++++++++\n\n* Article\n* Website\n\nYou can override by defining ``META_OBJECT_TYPES``/``META_FB_TYPES`` nested\ntuples in the project settings like::\n\n META_OBJECT_TYPES = (\n ('Article', _('Article')),\n ('Website', _('Website')),\n )\n\n META_FB_TYPES = (\n ('Article', _('Article')),\n ('Website', _('Website')),\n )\n\nTwitter\n+++++++\n\n* Summary Card\n* Summary Card with Large Image\n* App Card\n\nYou can override by defining ``META_TWITTER_TYPES`` nested\ntuples in the project settings like::\n\n META_TWITTER_TYPES = (\n ('summary', _('Summary Card')),\n ('summary_large_image', _('Summary Card with Large Image')),\n ('app', _('App Card')),\n )\n\nGoogle+ / Schema.org\n++++++++++++++++++++\n\n* Article\n* Blog\n* WebPage\n* WebSite\n* Event\n* Product\n* Place\n* Person\n\nYou can override by defining ``META_GPLUS_TYPES`` nested\ntuples in the project settings like::\n\n META_GPLUS_TYPES = (\n ('Article', _('Article')),\n ('Blog', _('Blog')),\n ('WebPage', _('Page')),\n ('WebSite', _('WebSite')),\n ('Event', _('Event')),\n ('Product', _('Product')),\n ('Place', _('Place')),\n ('Person', _('Person')),\n )\n\nSettings\n--------\n\nSome of the above properties can be set either in the model or via settings paramaters\n\n\n* image: ``META_DEFAULT_IMAGE`` (must be an absolute URL)\n* object_type: ``META_SITE_TYPE`` (default: first ``META_OBJECT_TYPES``)\n* og_type: ``META_FB_TYPE`` (default: first ``META_FB_TYPES``)\n* og_app_id: ``META_FB_APPID`` (default: blank)\n* og_profile_id: ``META_FB_PROFILE_ID`` (default: blank)\n* og_publisher: ``META_FB_PUBLISHER`` (default: blank)\n* og_author_url: ``META_FB_AUTHOR_URL`` (default: blank)\n* twitter_type: ``META_TWITTER_TYPE`` (default: first ``META_TWITTER_TYPES``)\n* twitter_site: ``META_TWITTER_SITE`` (default: blank)\n* twitter_author: ``META_TWITTER_AUTHOR`` (default: blank)\n* gplus_type: ``META_GPLUS_TYPE`` (default: first ``META_GPLUS_TYPES``)\n* gplus_author: ``META_GPLUS_AUTHOR`` (default: blank)\n\n\n\n\nHistory\n-------\n\n0.2.2 (XXXX-XX-XX)\n++++++++++++++++++\n\n* Use autoescape off in template for Django 1.9\n\n0.2.1 (2015-10-17)\n++++++++++++++++++\n\n* Add object types for facebook, twitter, google plus\n* Add translations\n\n0.2.0 (2015-10-03)\n++++++++++++++++++\n\n* Add support for using request in extracting metadata\n* Add one (optional) argument to class method call.\n* Add support for editorconfig\n* Add get_meta method to allow customising metadata\n* Use META_SITE_PROTOCOL when generating full URL\n* Extend documentation\n* Clean up the code\n* Use ``build_absolute_url`` instead of ``make_full_url``\n\n0.1.1 (2014-06-20)\n++++++++++++++++++\n\n* Add ``make_full_url`` method to retrieve complete object URL.\n\n0.1.0 (2014-04-19)\n++++++++++++++++++\n\n* First release on PyPI.", "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/nephila/django-meta-mixin", "keywords": "django-meta-mixin", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-meta-mixin", "package_url": "https://pypi.org/project/django-meta-mixin/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-meta-mixin/", "project_urls": { "Homepage": "https://github.com/nephila/django-meta-mixin" }, "release_url": "https://pypi.org/project/django-meta-mixin/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Social meta tags mixin for django-meta", "version": "0.3.0" }, "last_serial": 2034767, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "45c279ab4bd91ab02b9a8d20285c9c7a", "sha256": "e66c28ecb41c6d6543ba5bc36c0b303ddca54044939188fe39bbec3918850e44" }, "downloads": -1, "filename": "django_meta_mixin-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "45c279ab4bd91ab02b9a8d20285c9c7a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9118, "upload_time": "2014-04-19T09:47:29", "url": "https://files.pythonhosted.org/packages/2b/10/13a0f73ce80ac69e482981f3437c10e8077d5471959e3b679b1887eedbdb/django_meta_mixin-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35df85c7d3b37d7448480a384f4c6df1", "sha256": "d88f644f2ab70547067b815f747bb877c483af94d8487d443f19484d16b4566a" }, "downloads": -1, "filename": "django-meta-mixin-0.1.0.tar.gz", "has_sig": false, "md5_digest": "35df85c7d3b37d7448480a384f4c6df1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9881, "upload_time": "2014-04-19T09:47:26", "url": "https://files.pythonhosted.org/packages/e6/f0/a3b4b5ae0bb8f500f347f5f7da18136253bd9a5c26e538aa9d810595c9f3/django-meta-mixin-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a3d8b0bd09aa7878d42af41db8965d7b", "sha256": "09af739fbcf3c753d7fc0957c4469f3b550b3f75b0efe9170f66f6fc5fffbb8a" }, "downloads": -1, "filename": "django_meta_mixin-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3d8b0bd09aa7878d42af41db8965d7b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9314, "upload_time": "2014-06-20T11:30:36", "url": "https://files.pythonhosted.org/packages/4e/98/65ea947bef173609e50e3b9625d7c0ebfebd72ef8d596bf4e30230609626/django_meta_mixin-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac6b406ff043fbe765c372003ab42a69", "sha256": "093293d8903166a62379f3ed112f943a582a9bd63dd48709c3c7649af93b3cc8" }, "downloads": -1, "filename": "django-meta-mixin-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ac6b406ff043fbe765c372003ab42a69", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8274, "upload_time": "2014-06-20T11:30:32", "url": "https://files.pythonhosted.org/packages/44/3c/9ec01fc6b7d4ba9d3f5b683872a17f0d63c38161db41e44fd67a33096a27/django-meta-mixin-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "5f13c81bd474df2b7ceb78f62a825505", "sha256": "98f20da006f1403319558015b53927f9b97bca93d1740a66a8f3275ea86939a1" }, "downloads": -1, "filename": "django_meta_mixin-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5f13c81bd474df2b7ceb78f62a825505", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11729, "upload_time": "2015-10-03T11:33:53", "url": "https://files.pythonhosted.org/packages/cb/dd/c5e9cbabcdc95d80bd144aee2ab342db50836066216e39eefc34e581dd66/django_meta_mixin-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32eba5b94691f192bd91043bfc69412f", "sha256": "d97e3b84fc336095eef0a72125eda652a1f0283d4fc2eef8cdfefd733af248c0" }, "downloads": -1, "filename": "django-meta-mixin-0.2.0.tar.gz", "has_sig": false, "md5_digest": "32eba5b94691f192bd91043bfc69412f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11679, "upload_time": "2015-10-03T11:33:49", "url": "https://files.pythonhosted.org/packages/e6/0b/41ce1d21321557851ffd32b08929ebdd843ff5147f5ba9679966fe9c7b70/django-meta-mixin-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1a8576025a5821dc1bed3c4a907b62fa", "sha256": "c95973846c571b1d4d817eb57475a11188de066602b576ab46463194f1f9f737" }, "downloads": -1, "filename": "django_meta_mixin-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1a8576025a5821dc1bed3c4a907b62fa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12351, "upload_time": "2015-10-17T14:02:39", "url": "https://files.pythonhosted.org/packages/76/93/275f6936867149697273d0d464e58f048319ca13bf2b12b2d4f232f37329/django_meta_mixin-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bda21b09ed7ae98b0713c3b6c7f85b1f", "sha256": "31b6f9c2ce5127a8ac16b6a6a47181df9c3190a4a962865f7203ea0128cbc79c" }, "downloads": -1, "filename": "django-meta-mixin-0.2.1.tar.gz", "has_sig": false, "md5_digest": "bda21b09ed7ae98b0713c3b6c7f85b1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9928, "upload_time": "2015-10-17T14:02:06", "url": "https://files.pythonhosted.org/packages/cb/e2/ce35890a174d42a624f44082ccd062453da35f6f4542f56ff6e4641b9b40/django-meta-mixin-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "add4e4f0f60975e162f815c6b6e32d80", "sha256": "1d257a0557382c39c21b1f9cf6da470196e36413824d0b20143a31a566184049" }, "downloads": -1, "filename": "django_meta_mixin-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "add4e4f0f60975e162f815c6b6e32d80", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9576, "upload_time": "2016-03-29T21:55:41", "url": "https://files.pythonhosted.org/packages/af/43/f7fa4b37cc28d20498f73ac738249a7757f87e32fb6e63b0e05ab672d650/django_meta_mixin-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d9ed1dd7f7d0bc1ac067d063163f091", "sha256": "b3910fd7b45c55660f49674c555a786abfbcd8a2518e3cf6565795eabea83929" }, "downloads": -1, "filename": "django-meta-mixin-0.3.0.tar.gz", "has_sig": false, "md5_digest": "8d9ed1dd7f7d0bc1ac067d063163f091", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8213, "upload_time": "2016-03-29T21:55:34", "url": "https://files.pythonhosted.org/packages/69/ba/fa6bddb77ea324bbd8865d21013ac5361d45da83fb29aba8c1bf068de893/django-meta-mixin-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "add4e4f0f60975e162f815c6b6e32d80", "sha256": "1d257a0557382c39c21b1f9cf6da470196e36413824d0b20143a31a566184049" }, "downloads": -1, "filename": "django_meta_mixin-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "add4e4f0f60975e162f815c6b6e32d80", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9576, "upload_time": "2016-03-29T21:55:41", "url": "https://files.pythonhosted.org/packages/af/43/f7fa4b37cc28d20498f73ac738249a7757f87e32fb6e63b0e05ab672d650/django_meta_mixin-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d9ed1dd7f7d0bc1ac067d063163f091", "sha256": "b3910fd7b45c55660f49674c555a786abfbcd8a2518e3cf6565795eabea83929" }, "downloads": -1, "filename": "django-meta-mixin-0.3.0.tar.gz", "has_sig": false, "md5_digest": "8d9ed1dd7f7d0bc1ac067d063163f091", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8213, "upload_time": "2016-03-29T21:55:34", "url": "https://files.pythonhosted.org/packages/69/ba/fa6bddb77ea324bbd8865d21013ac5361d45da83fb29aba8c1bf068de893/django-meta-mixin-0.3.0.tar.gz" } ] }