{
"info": {
"author": "Praekelt Foundation",
"author_email": "dev@praekeltfoundation.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Framework :: Django",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content"
],
"description": "Django Pummel\n=============\n**Django app providing PML templates, tags and middleware.**\n\n|travis|_\n\n.. |travis| image:: https://magnum.travis-ci.com/praekelt/django-pummel.svg?token=hvdqE3zapc2LPyKs2zQC&branch=develop\n\n.. contents:: Contents\n :depth: 5\n\n\nUsage\n-----\n\nForms\n~~~~~\n\nForm fields, widgets and renderers are included so you can easily render forms. Forms should inherit from ``PMLForm`` and utilize included PML fields as illustrated by the following::\n\n from pml import forms\n\n class DemoForm(forms.PMLForm):\n submit_text = \"Submit Text\"\n text_field = forms.PMLTextField(\n label=\"Text Field Label\",\n help_text=\"Text Field Help Text\"\n )\n select_field = forms.PMLSelectField(\n label=\"Select Field Label\",\n help_text=\"Select Field Help Text\",\n choices=(\n (\"value1\", \"select 1\"),\n (\"value2\", \"select 2\"),\n )\n )\n checkbox_field = forms.PMLCheckBoxField(\n label=\"Check Box Field Label\",\n help_text=\"Check Box Field Help Text\",\n choices=(\n (\"value1\", \"checkbox 1\"),\n (\"value2\", \"checkbox 2\"),\n )\n )\n radio_field = forms.PMLRadioField(\n label=\"Radio Field Label\",\n help_text=\"Radio Field Help Text\",\n choices=(\n (\"value1\", \"radio 1\"),\n (\"value2\", \"radio 2\"),\n )\n )\n\nYou can then render the form by calling the following include in your template(which assumes a ``form`` context variable is available), i.e.::\n\n {% include 'pml/inclusion_tags/form.xml' %}\n\nwhich will render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/form.png\n\nMiddleware\n~~~~~~~~~~\n\nVLiveRemoteUserMiddleware\n+++++++++++++++++++++++++\n\nTo automatically create and authenticate users using MSISDNs as provided by VLive include ``VLiveRemoteUserMiddleware`` and ``RemoteUserBackend`` in your settings, i.e::\n\n MIDDLEWARE_CLASSES = (\n ...\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\n 'pml.middleware.VLiveRemoteUserMiddleware',\n ...\n )\n\n AUTHENTICATION_BACKENDS = (\n ...\n 'django.contrib.auth.backends.RemoteUserBackend',\n )\n\nWith this setup ``VLiveRemoteUserMiddleware`` will detect the username in ``request.META['HTTP_X_UP_CALLING_LINE_ID']`` and will authenticate and auto-login that user using the ``RemoteUserBackend``.\n\nYou can also specify ``REMOTE_USER_IGNORE_PATH = ['/vlivebanner/', ]`` to ignore certain paths. Especially for banners, you don't want new users logged when they in actual fact haven't visited the site but only seen the banner.\n\n\nRedirectMiddleware\n++++++++++++++++++\n\nPML requires an intermediary page when redirecting, conventional HTTP 302's are not supported. To automatically create this intermediary page include ``RedirectMiddleware`` as your first middleware class, i.e.::\n\n MIDDLEWARE_CLASSES = (\n 'pml.middleware.RedirectMiddleware',\n ...\n )\n\nWith this setup all redirects will be intercepted and the ``pml/redirect.xml`` template will be rendered as a normal ``HttpResponse``, including `user messages `_ and PML redirect XML as created by the ``redirect`` tag (see below).\n\n\nInclusion Tags\n~~~~~~~~~~~~~~\n\nbanner\n++++++\n\nRenders an image specified by ``image_url`` argument as a banner, i.e.::\n\n {% banner image_url='/url/to/image.png' %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/banner.png\n\nThe provided image should have a resolution of 241x60px. The Vodafone Live PML platform will resize it for specific devices.\n\ndivider\n++++++\n\nRenders a divider, i.e.::\n\n {% divider %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/divider.png\n\nHeaders are tandalone modules so you can not use them within other modules.\n\nheader\n++++++\n\nRenders a header bar with provided ``text`` and ``color``, i.e.::\n\n {% header text='Featured' color='pink' %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/header.png\n\nHeaders are standalone modules so you can not use them within other modules.\n\n\nhorizontal_links\n++++++++++++++++\n\nRenders horizontal links for collection of ``objects``. Link url and text is looked up from properties on individual objects as specified by the ``url_property`` and ``text_property`` arguments i.e.::\n\n {% horizontal_links objects=object_list url_property='get_absolute_url' text_property='title' %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/horizontal_links.png\n\nlink_list\n+++++++++\n\nRenders bulleted links for collection of ``objects``. Link url and text is looked up from properties on individual objects as specified by the ``url_property`` and ``text_property`` arguments i.e.::\n\n {% link_list objects=object_list url_property='get_absolute_url' text_property='title' %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/link_list.png\n\n\nredirect\n++++++++\n\nRenders PML redirect XML causing a client side HTML redirect to provided ``url`` after the specified ``seconds`` i.e.::\n\n {% redirect seconds='2' url='http://www.google.com' %}\n\nwill render the following XML::\n\n \n\nIf no ``url`` is provided ``request.META['HTTP_REFERER']`` will be used instead. ``redirect`` will only work if included before ```` in your templates (if you extend from ``pml/base.xml`` include it as part of the ``header`` block) and your template contains other content (empty templates won't redirect).\n\n\ntext_module\n+++++++++++\n\nRenders evaluated HTML reformated for display within a PML ```` element. The provided ``html`` is evaluated so you can specify tags and context variables is if you were creating normal Django template code, i.e.::\n\n {% text_module html='bold
link
italic' %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/text_module.png\n\nthumbnail_html\n++++++++++++++\n\nRenders a thumbnail image followed by evaluated HTML reformated for display within a PML ```` element. The provided ``html`` is evaluated so you can specify tags and context variables is if you were creating normal Django template code, i.e.::\n\n {% thumbnail_html image_url='/url/to/image.png' html='bold
link
italic' %}\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/thumbnail_html.png\n\nthumbnail_include\n+++++++++++++++++\n\nRenders a thumbnail image followed by evaluated HTML reformated for display within a PML ```` element, as included from the provided ``template`` argument. This should be used instead of ``thumbnail_html`` above if you need to include complex elements (i.e. other tags) that can't be included as part of other tags, i.e. ::\n\n {% thumbnail_include image_url='/url/to/image.png' template='path/to/template' %}\n\nwith the template containing::\n\n bold
\n link
\n italic\n\nwill render as\n\n.. image:: https://github.com/praekelt/django-pummel/raw/develop/rst_media/thumbnail_html.png\n\n.. note::\n\n All tags accept a ``color`` argument allowing you to specify background and link colors. Valid colors are orange, green, dove, marine, violet, red, black, grey, sand, pink, and darkred.\n\nTemplates\n~~~~~~~~~\n\nA ``pml/base.xml`` template is included from which you can ``extend`` as a starting point for your PML templates. The template includes a ``header`` and ``body`` block. You'll use the ``body`` block for the most of your content, but some tags like ``redirect`` needs to be placed in the ``header`` block.",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://github.com/praekelt/django-pummel",
"keywords": null,
"license": "Proprietary",
"maintainer": null,
"maintainer_email": null,
"name": "django-pummel",
"package_url": "https://pypi.org/project/django-pummel/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/django-pummel/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://github.com/praekelt/django-pummel"
},
"release_url": "https://pypi.org/project/django-pummel/0.0.8/",
"requires_dist": null,
"requires_python": null,
"summary": "Django PML template tags and utils (djang-pml was taken, okay!)",
"version": "0.0.8"
},
"last_serial": 1121626,
"releases": {
"0.0.1": [
{
"comment_text": "",
"digests": {
"md5": "6edf349d92c8efbdd98c66ee9658a8b6",
"sha256": "4c9087ec2b784192f32e3168d461ea61ed4078be40f3c08884e8826d636dcdc8"
},
"downloads": -1,
"filename": "django-pummel-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "6edf349d92c8efbdd98c66ee9658a8b6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 139946,
"upload_time": "2013-09-18T04:41:03",
"url": "https://files.pythonhosted.org/packages/a7/fa/0c1713091907381f029279e5982637222efa54643e7071655790afa5f20f/django-pummel-0.0.1.tar.gz"
}
],
"0.0.2": [
{
"comment_text": "",
"digests": {
"md5": "5141bedc04d87f1ca64f426e9482415b",
"sha256": "a8c997f5f9704664d7e54dff9b0c34df4bad5a525c1bc3c98b785f668a205e2e"
},
"downloads": -1,
"filename": "django-pummel-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "5141bedc04d87f1ca64f426e9482415b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 140893,
"upload_time": "2013-10-21T07:53:38",
"url": "https://files.pythonhosted.org/packages/93/d6/3252aebd114e396bdd18b81cf8e7473bbc074ba0e5ba4e98dde26c7ac33b/django-pummel-0.0.2.tar.gz"
}
],
"0.0.3": [
{
"comment_text": "",
"digests": {
"md5": "37f114c77f5158a96484d4a9a91a2cbb",
"sha256": "726aa46587bffab5c69770482d6ac6bd94dd9d1865067e3bdc10e6b8d099392c"
},
"downloads": -1,
"filename": "django-pummel-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "37f114c77f5158a96484d4a9a91a2cbb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 140960,
"upload_time": "2013-12-10T15:37:12",
"url": "https://files.pythonhosted.org/packages/1c/50/2c45955e942a43ff773c5acae0e46d12c2707ddea5030c5c12e4679209db/django-pummel-0.0.3.tar.gz"
}
],
"0.0.4": [
{
"comment_text": "",
"digests": {
"md5": "f775f603db5174d16c232f5017aba96a",
"sha256": "cc677010a15a9e059e49ea0ddc686a03982f8aac6c4556dc0fbe5758adacc7ac"
},
"downloads": -1,
"filename": "django-pummel-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "f775f603db5174d16c232f5017aba96a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 140943,
"upload_time": "2013-12-11T06:50:40",
"url": "https://files.pythonhosted.org/packages/86/f7/dd5d6cb27fa58e31b231211bbdf1a0460f1834cc0074af9ab969dfd184b3/django-pummel-0.0.4.tar.gz"
}
],
"0.0.5": [
{
"comment_text": "",
"digests": {
"md5": "4890c158e7361b53ec9b746175c8f005",
"sha256": "07941c733a1b9d3b2cd0d3f60ac87b0ac62285edb064489839cfcbfac7653729"
},
"downloads": -1,
"filename": "django-pummel-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "4890c158e7361b53ec9b746175c8f005",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 140981,
"upload_time": "2014-04-25T11:05:42",
"url": "https://files.pythonhosted.org/packages/d4/78/0747691ecc8eb828e3a7ec3a8383d5ee4d1a8a34b9ddebad068f6610002c/django-pummel-0.0.5.tar.gz"
}
],
"0.0.6": [
{
"comment_text": "",
"digests": {
"md5": "f2ef1a3d633e02569557cf873ea3dddb",
"sha256": "edc30ce1445d193e011b9fa995f61824194e07007ad9c863235438cc4a71e084"
},
"downloads": -1,
"filename": "django-pummel-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "f2ef1a3d633e02569557cf873ea3dddb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 140979,
"upload_time": "2014-04-25T12:58:10",
"url": "https://files.pythonhosted.org/packages/dd/ea/e95bc04373dba4da89f4017f2ddc47edfaabadc8cc97990d5efffdb2cf8d/django-pummel-0.0.6.tar.gz"
}
],
"0.0.7": [
{
"comment_text": "",
"digests": {
"md5": "71697427a03c6a974547bee7376790ce",
"sha256": "db3df978435642e4d19140281fad173e858377cb601df39bfc510f43eeb1bad8"
},
"downloads": -1,
"filename": "django-pummel-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "71697427a03c6a974547bee7376790ce",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 141096,
"upload_time": "2014-05-06T08:18:16",
"url": "https://files.pythonhosted.org/packages/8b/0a/5e39fbe3339cb0d42409144912f34b1b0ccd2136a983534d68f7b02a0d7e/django-pummel-0.0.7.tar.gz"
}
],
"0.0.8": [
{
"comment_text": "",
"digests": {
"md5": "8c3a29b0d1f6c0e2d1e46009430e6c6c",
"sha256": "9dd915a9ffef4d7e1b2f072f99005ba499a8284a7299cb99a1e2bab8f4ed6453"
},
"downloads": -1,
"filename": "django-pummel-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "8c3a29b0d1f6c0e2d1e46009430e6c6c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 141645,
"upload_time": "2014-06-11T14:10:34",
"url": "https://files.pythonhosted.org/packages/0a/a9/3c62457c7ad594332bb3bb408503cc19df8c120bd42ba45cb4a4575194e0/django-pummel-0.0.8.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "8c3a29b0d1f6c0e2d1e46009430e6c6c",
"sha256": "9dd915a9ffef4d7e1b2f072f99005ba499a8284a7299cb99a1e2bab8f4ed6453"
},
"downloads": -1,
"filename": "django-pummel-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "8c3a29b0d1f6c0e2d1e46009430e6c6c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 141645,
"upload_time": "2014-06-11T14:10:34",
"url": "https://files.pythonhosted.org/packages/0a/a9/3c62457c7ad594332bb3bb408503cc19df8c120bd42ba45cb4a4575194e0/django-pummel-0.0.8.tar.gz"
}
]
}