{ "info": { "author": "Christian Metts", "author_email": "xian@mintchaos.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "What's this then?\n=================\n\nDjango Inlines is an app to let you use include other objects and special \nbits in your text fields.\n\nIt uses a registration style so it's easy to set up inlines for any of your apps\nor third party applications.\n\n\nExample:\n********\n\nRegister your inlines::\n\n from django_inlines import inlines\n from django_inlines.samples import YoutubeInline\n \n inlines.registry.register('youtube', YoutubeInline)\n\nIn your `entry.body`::\n\n

Check out my new video:

\n \n {{ youtube http://www.youtube.com/watch?v=RXJKdh1KZ0w }}\n\nIn your template::\n\n {% load inlines %}\n {% process_inlines entry.body %}\n\nOutput::\n\n

Check out my new video:

\n\n
\n \n \n \n \n \n \n
\n\n\nCreating inlines\n****************\n\nAn inline can be any class that provides a `render` method and has an \n`__init__` that can take these arguments:: \n\n __init__(self, value, variant=None, context=None, template_dir=\"\", **kwargs)\n \nDjango Inlines comes with the base inline classes you can subclass to create\nyour own inlines.\n\n\n``inlines.InlineBase``\n----------------------\n\n A base class for overriding to provide simple inlines.\n The `render` method is the only required override. It should return a string.\n or at least something that can be coerced into a string.\n\n\n``inlines.TemplateInline``\n--------------------------\n\n A base class for overriding to provide templated inlines.\n The `get_context` method is the only required override. It should return \n dictionary-like object that will be fed to the template as the context.\n \n If you instantiate your inline class with a context instance, it'll use\n that to set up your base context.\n \n Any extra arguments assigned to your inline are passed directly though to\n the context.\n\nSee ``samples.YoutubeInline`` for an example of a ``TemplateInline``\nsubclass.\n\nTemplate inlines render a template named the same as the name they were \nregistered as. The youtube inline uses ``inlines/youtube.html``\n\n\n``inlines.ModelInline``\n-----------------------\n \n A base class for creating inlines for Django models. The `model` class\n attribute is the only required override. It should be assigned a django\n model class.\n\nA sample model inline::\n\n from myapp.models import Photo\n \n class PhotoInline(inlines.ModelInline):\n model = Photo\n\n inlines.registry.register('photo', PhotoInline)\n\nAnd in use::\n\n {{ photo 1 }}\n\nModelInlines take an object's `id` as it's only value and pass that object into \nthe context as ``object``.\n\nSince model inlines will be used very often there is a ``inline_for_model`` \nshortcut method for this. It can be used to register models as inlines directly::\n\n from django_inlines.inlines import inline_for_model\n inlines.registry.register('photo', inline_for_model(Photo))\n\n\nInline syntax\n*************\n\nDjango inlines use this syntax ``{{ name[:variant] value [argument=value ...] }}``\n\n``name``\n\n The name the inline has been registered under. Template inlines use this as\n the base name for their templates.\n \n``value``\n\n Any string. It's the requirement of the inline class to parse this string.\n\n``variant`` `optional`\n\n Variants can be used by the inline class to alter behavior. By default any\n inline that renders a template uses this to check for an alternate template.\n ``{{ youtube:hd }}`` would first check for ``inlines/youtube.hd.html``\n before checking for ``inlines/youtube.html``.\n\n``arguments`` `optional`\n\n Any number of key=value pairs are allowed at the end of an inline. These\n are passed directly to the template as context vars.\n ``{{ youtube:hd width=400 height=200 }}``\n\n\nThe template tag\n****************\n\nSearches through the provided content and applies inlines where ever they are\nfound. The current context of your template is passed into to your inline templates.\n\nSyntax::\n\n{% process_inlines entry.body [in template_dir] [as varname] }\n\n\nExample::\n\n {% process_inlines entry.body %}\n\n {% process_inlines entry.body as body %}\n\n {% process_inlines entry.body in 'inlines/sidebar' %}\n\n {% process_inlines entry.body in 'inlines/sidebar' as body %}\n\nIf given the optional template_dir argument inlines will first check in that \ndirectory for their template before falling back to ``inlines/.html``\n\nIf given [as varname] the tag won't return anything but will instead populate\nvarname in your context. Then you can apply filters or test against the output.\n\n\nSettings\n********\n\nYou can override some settings within your ``settings.py``:\n\n- ``INLINE_DEBUG = True``: Normally a error with your inlines would fail silently.\n Turning this to ``True`` would raise all exceptions your inlines might produce. \n Default: ``False``\n\n- ``INLINES_START_TAG = '{{'``: The start tag used in the inline syntax.\n Default: ``'{{'``\n \n- ``INLINES_END_TAG = '}}'``: The end tag used in the inline syntax.\n Default: ``'}}'``\n\n\nTo do:\n******\n\n**Warning:** Django inlines is still under development. Every thing here is \nwell tested and functional, but stability isn't promised yet. Important bits \ndon't exist yet. These include:\n\n* Better documentation.\n* Admin style auto discovery of inlines.py in your apps.\n* Adding validation hooks to the base classes.\n* A model field and a widget for validation and improved adding in the admin.\n\n\nChanges:\n========\n\n0.7.2\n*****\n\nBug fixes:\n\n* Arguments now work correctly (thanks to Martin Mahner).\n* Fixed a bug in the regex that would split passed values incorrectly occasionally.\n\nNew:\n\n* START_TAG and END_TAG can now be controlled via settings.\n\n\n0.7.1\n*****\n\n* Includes fixes from Jannis Leidel so it actually works on Pypi now. Thanks Jannis!\n\n\n0.7\n***\n\n* Initial public release", "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/mintchaos/django_inlines", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django_inlines", "package_url": "https://pypi.org/project/django_inlines/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_inlines/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/mintchaos/django_inlines" }, "release_url": "https://pypi.org/project/django_inlines/0.7.4/", "requires_dist": null, "requires_python": null, "summary": "For embedding anything you'd like into text in your django apps.", "version": "0.7.4" }, "last_serial": 791112, "releases": { "0.7": [ { "comment_text": "", "digests": { "md5": "96e2ee988e3130deb7266993b2b01c65", "sha256": "1725d8d3d13437901721a3ed370e3df0fe7e84dccdbc5d6062fe1dd5ce869059" }, "downloads": -1, "filename": "django_inlines-0.7.tar.gz", "has_sig": false, "md5_digest": "96e2ee988e3130deb7266993b2b01c65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5747, "upload_time": "2009-04-25T08:40:22", "url": "https://files.pythonhosted.org/packages/1c/cd/30cdac5accc002b5fe42f12f9a8a0016451218044cc64afd0c1b28f58497/django_inlines-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "3bc506864c8ab4907bfb99ed0d9c6496", "sha256": "835922fa7e8d1f1a51df93e49de37954cb1a40a3bd7b1a34889f8ed124288854" }, "downloads": -1, "filename": "django_inlines-0.7.1.tar.gz", "has_sig": false, "md5_digest": "3bc506864c8ab4907bfb99ed0d9c6496", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8112, "upload_time": "2009-04-25T21:51:06", "url": "https://files.pythonhosted.org/packages/c1/7b/ce9e0464482a4695f60d1cdb045a8f15e6a5c40bc07513241d24a553ad62/django_inlines-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "d7e2c8ed111402226b821ef2d4d7a230", "sha256": "852d7ec2d3ac388dfea4b0932c2077211d37f328167afe559c37f73389495a68" }, "downloads": -1, "filename": "django_inlines-0.7.2.tar.gz", "has_sig": false, "md5_digest": "d7e2c8ed111402226b821ef2d4d7a230", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8461, "upload_time": "2009-04-27T06:55:33", "url": "https://files.pythonhosted.org/packages/f3/9c/f6b29807fb7932b67675c917318c2db9389724f52d107aa243643eb2d7a2/django_inlines-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "26d82b43ab86280507338900d035f037", "sha256": "590033172702a7e1df2f92e572b11cee64aba3e72a323cd0d3e7cd5b7dc46fa7" }, "downloads": -1, "filename": "django_inlines-0.7.3.tar.gz", "has_sig": false, "md5_digest": "26d82b43ab86280507338900d035f037", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8613, "upload_time": "2009-05-05T10:22:24", "url": "https://files.pythonhosted.org/packages/ce/71/f7a040ecf873148465d639f98bf418297a9c6550567c45e623cd4e423dae/django_inlines-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "a2c7589ea2af8e7e352aa7206e7c8808", "sha256": "bea7983fa9139c5930143b58a205a200c5b702d2488b2c59aba644ddf6c9b675" }, "downloads": -1, "filename": "django_inlines-0.7.4.tar.gz", "has_sig": false, "md5_digest": "a2c7589ea2af8e7e352aa7206e7c8808", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12089, "upload_time": "2009-05-13T08:55:26", "url": "https://files.pythonhosted.org/packages/4a/3b/5c0b79331a21bdb3079cfd7f40a981185e13a39cfc14db35a5b4b6a7e1c0/django_inlines-0.7.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a2c7589ea2af8e7e352aa7206e7c8808", "sha256": "bea7983fa9139c5930143b58a205a200c5b702d2488b2c59aba644ddf6c9b675" }, "downloads": -1, "filename": "django_inlines-0.7.4.tar.gz", "has_sig": false, "md5_digest": "a2c7589ea2af8e7e352aa7206e7c8808", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12089, "upload_time": "2009-05-13T08:55:26", "url": "https://files.pythonhosted.org/packages/4a/3b/5c0b79331a21bdb3079cfd7f40a981185e13a39cfc14db35a5b4b6a7e1c0/django_inlines-0.7.4.tar.gz" } ] }