{ "info": { "author": "Simon Willison", "author_email": "simon@simonwillison.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "===========\ndjango_html\n===========\n\nThis package represents an experimental approach to improving the way Django\noutputs form widgets. At the moment, widgets created using `django.forms` are\noutputted as XHTML (with self closing `/>` tags) even if the rest of your site\nuses HTML. This package solves this problem by introducing three new template\ntags: `{% doctype %}`, `{% field %}` and `{% slash %}`.\n\nTo install, place the `django_html` directory somewhere on your python path,\nthen add `django_html` to `INSTALLED_APPS` in your `settings.py` file.\n\nSee the following thread on django-developers for further background\ninformation:\n http://groups.google.com/group/django-developers/browse_thread/thread/5f3694b8a19fb9a1/\n\n{% doctype %}\n=============\nThe doctype tag does two things: it outputs the relevant doctype and it stores\nyour chosen doctype in `context._doctype`. Example usage::\n\n\t{% load html %}{% doctype \"html4\" %}\n\nThis will output::\n\n\t\n\nIt will also set the context's doctype to \"html4\". Other template tags can \nthen take that in to account when deciding how they should render.\n\nIf you just want to set the doctype without outputting it to the page you can\nuse the optional \"silent\" argument::\n\n\t{% doctype \"html4\" silent %}\n\n{% field %}\n===========\n\nThe field tag allows you to output `django.forms` widgets taking the current\nactive doctype in to account. Django outputs XHTML form widgets by default but\nthis may not be appropriate if your site uses HTML 4. Here's how you output a\nform widget with stock Django::\n\n\t {{ form.name }}\n\nThis will always output as XHTML. Here's how you use the new `{% field %}` \ntag::\n\n\t {% field form.name %}\n\nNow the current doctype (as set using the {% doctype %} tag) will be used to\ndecide if XHTML self-closing tags should be used by the widget.\n\nThe field tag also lets you specify extra HTML attributes for a form field \nfrom within your template (useful for adding things like extra classes without\nhaving to modify the form definition in your Python code)::\n\n\t {% field form.name class=\"myclass\" %}\n\nWith an HTML doctype, this will render as::\n\n\t\n\nIf your doctype is XHTML, you will get::\n\n\t\n\n{% slash %}\n===========\n\nThis tag is included for completeness. Authors of reusable apps which ship \nwith their own templates (extending base.html) might want to ensure that their \napps use the correct markup for the current doctype. In practise, this means \noutputting a self-closing tag for a small number of HTML elements. The \n`{% slash %}` tag simply outputs the string \" /\" for an XHTML doctype and \nrenders blank for an HTML doctype. Here are some examples::\n\n \n \n \"My", "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/simonw/django-html", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-html", "package_url": "https://pypi.org/project/django-html/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-html/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/simonw/django-html" }, "release_url": "https://pypi.org/project/django-html/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Template tags for smarter outputting of HTML in Django", "version": "0.1.0" }, "last_serial": 789818, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8613f072be6afd984580c06256ea5090", "sha256": "7c94c35069badd02ef4ea13241fad6d78ce900ca1830a5eaf1aa1ffdc9243664" }, "downloads": -1, "filename": "django-html-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8613f072be6afd984580c06256ea5090", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6135, "upload_time": "2010-03-29T22:26:42", "url": "https://files.pythonhosted.org/packages/04/ac/4273e653943af92a13c5cf1837bd81a1c4956f3f3ba3ce5dcff52b48cdbc/django-html-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8613f072be6afd984580c06256ea5090", "sha256": "7c94c35069badd02ef4ea13241fad6d78ce900ca1830a5eaf1aa1ffdc9243664" }, "downloads": -1, "filename": "django-html-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8613f072be6afd984580c06256ea5090", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6135, "upload_time": "2010-03-29T22:26:42", "url": "https://files.pythonhosted.org/packages/04/ac/4273e653943af92a13c5cf1837bd81a1c4956f3f3ba3ce5dcff52b48cdbc/django-html-0.1.0.tar.gz" } ] }