{ "info": { "author": "Derek Payton", "author_email": "derek.payton@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====================\ndjango-embedded-media\n=====================\n\n.. image:: https://travis-ci.org/dmpayton/django-embedded-media.png\n :target: https://travis-ci.org/dmpayton/django-embedded-media\n\n:Author: `Derek Payton`_\n:Version: 0.1.0\n:License: `MIT`_\n\nEver run into a situation where it would just be *so incredibly handy* to be\nable to render inline CSS or JS in your Django form media?\n\nThis lets you do that.\n\nIt all started with ticket `#13978`_, which I championed for a while. However,\nI no longer think this is a good feature to have in Django. After using the\n`#13978`_ patch for a while, I've come to realize that it's just too damn easy\nto rely on it too much. No one wants to see a two-dozen line string of\njQueryfied JS in the middle of their Django form class.\n\nHowever, if you've got the need for spee^H^H^H^Hembedded media -- and you think\nyou're disciplined enough to not start writing all your CSS and JS as strings\nin your .py files -- then django-embedded-media makes it possible.\n\nInstallation\n============\n\nUse `pip`_, obviously::\n\n $ pip install django-embedded-media\n\nUsage\n=====\n\nThere's no special configuration needed. It's a Django app, technically, but\nyou don't need to put it into INSTALLED_APPS. Just install the package and\nstart embedding your styles and scripts.\n\nWorks on forms:\n\n.. code:: python\n\n >>> from django import forms\n >>> import embedded_media as emb\n >>>\n >>> class MyForm(forms.Form):\n ... class Media:\n ... css = {'all': (emb.CSS('.mywidget { display: none; }'),)}\n ... js = (emb.JS('init_mywidget();'),)\n\n >>> print MyForm.media\n \n \n >>>\n\nWorks on form widgets:\n\n.. code:: python\n\n >>> from django import forms\n >>> import embedded_media as emb\n >>>\n >>> class MyWidget(forms.TextInput):\n ... class Media:\n ... css = {'all': (emb.CSS('.mywidget { display: none; }'),)}\n ... js = (\n ... 'whizbang.js',\n ... emb.JS('init_mywidget();'),\n ... )\n\n >>> print MyWidget().media\n \n \n \n >>>\n\nWorks as a dynamic media property:\n\n.. code:: python\n\n >>> from django import forms\n >>> import embedded_media as emb\n >>>\n >>> class MyForm(forms.Form):\n ... def _media(self):\n ... return Media(\n ... css={'all': (emb.CSS('.mywidget { display: none; }'),)},\n ... js=(emb.JS('init_mywidget();'),)\n ... )\n ... media = property(_media)\n\n >>> print MyForm().media\n \n \n >>>\n\nTesting\n=======\n\nThe tests require `Django`_, `coverage`_, and `pep8`_, which are conveniently\nlisted in requirements.txt::\n\n $ pip install -r requirements.txt\n $ python setup.py test\n\n.. _Derek Payton: http://dmpayton.com/\n.. _MIT: https://github.com/dmpayton/django-embedded-media/blob/master/LICENSE\n.. _#13978: https://code.djangoproject.com/ticket/13978\n.. _pip: http://www.pip-installer.org/\n.. _Django: https://crate.io/packages/Django/\n.. _coverage: https://crate.io/packages/coverage/\n.. _pep8: https://crate.io/packages/pep8/", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/dmpayton/django-embedded-media/tarball/v0.1.0", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dmpayton/django-embedded-media", "keywords": "django media", "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-embedded-media", "package_url": "https://pypi.org/project/django-embedded-media/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-embedded-media/", "project_urls": { "Download": "https://github.com/dmpayton/django-embedded-media/tarball/v0.1.0", "Homepage": "https://github.com/dmpayton/django-embedded-media" }, "release_url": "https://pypi.org/project/django-embedded-media/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Render inline CSS and JS in Django forms media.", "version": "0.1.0" }, "last_serial": 873239, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "039a95b375a2718796c3dfc552f9717d", "sha256": "299fcd173dae5e87f6cd7e94c3b8de4ada4e2beafe45783513b69281211f0eb5" }, "downloads": -1, "filename": "django-embedded-media-0.1.0.tar.gz", "has_sig": false, "md5_digest": "039a95b375a2718796c3dfc552f9717d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4875, "upload_time": "2013-09-24T22:09:47", "url": "https://files.pythonhosted.org/packages/3a/1a/4c2899c91d5c7497e0e0d2f4d998ae10d5f031074970b47ec776070a4e70/django-embedded-media-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "039a95b375a2718796c3dfc552f9717d", "sha256": "299fcd173dae5e87f6cd7e94c3b8de4ada4e2beafe45783513b69281211f0eb5" }, "downloads": -1, "filename": "django-embedded-media-0.1.0.tar.gz", "has_sig": false, "md5_digest": "039a95b375a2718796c3dfc552f9717d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4875, "upload_time": "2013-09-24T22:09:47", "url": "https://files.pythonhosted.org/packages/3a/1a/4c2899c91d5c7497e0e0d2f4d998ae10d5f031074970b47ec776070a4e70/django-embedded-media-0.1.0.tar.gz" } ] }