{ "info": { "author": "Brutus", "author_email": "brutus.dmc@googlemail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "# WTForms HTML5\n\n![Build Status][badge-travis] ![Code Status][badge-landscape] ![Coverage Status][badge-coveralls]\n\nGenerates render keywords for [WTForms][] HTML5 field's widgets.\n\n_Original Function_: This module used to add HTML5 support to _WTForms_.\n\nIt supported the new INPUT __types__ for fields and had also set some of the new\nINPUT __attributes__ automatically for the generated HTML Input elements (based\non widget type and what kind of validator was set for the field).\n\n_Changes_: _WTForms_ version 1.0.4 started to implement some of these features\nand the current (late 2016) development version \u2014 that should become version 3 \u2014\nhas enough support for all that features, that to prevent the duplication of\nfunctionality, current versions of __WTForms HTML5__ dropped all the fields,\nwidgets and validators \u2014 just use vanilla _WTForms_.\n\n_Current Function_: recent versions (starting with 0.2) contain only one\nfunction: `get_html5_kwargs` \u2014 it adds the automatically generated keys to the\n_render keywords_ of a _WTForms_ field.\n\nA slim subclass of the new default _Meta_ class for forms is also provided:\n`AutoAttrMeta`. If you use this class as your forms _Meta_, you get the\nautomatic attributes for all fields in your form, just like in the original\nversion of __WTForms HTML5__.\n\n\n## Supported Auto\u2013Attributes\n\n- __required__\n\n Is set if the field has the ``required`` flag set.\n\n This happens if you use the _DataRequired_ or _InputRequired_ validator.\n\n- __invalid__\n\n If the field got any validation errors, the CSS class _invalid_ is added.\n\n- __min__ and __max__\n\n If either _Length_ or _NumberRange_ is used as a validator and sets a minimal\n or maximal value, the corresponding INPUT attribute is set.\n\n- __title__\n\n If no _title_ attribute is provided for a field, but a _description_, the\n _description_ is used for the _title_.\n\n\n## Example\n\nDeclare your form just like in vanilla _WTForms_, but include `AutoAttrMeta`\nas your meta class:\n\n```py\n>>> from wtforms import Form, StringField\n>>> from wtforms.validators import InputRequired, Length\n>>> from wtforms_html5 import AutoAttrMeta\n>>> class MyForm(Form):\n... class Meta(AutoAttrMeta):\n... pass\n... test_field = StringField(\n... 'Testfield',\n... validators=[InputRequired(), Length(min=3, max=12)],\n... description='Just a test field.',\n... )\n>>> form = MyForm()\n```\n\n__The only difference is, that you include a `Meta` class, that inherits from\n`AutoAttrMeta`.__\n\nNow you get some attributes created automatically for your fields:\n\n```py\n>>> form.test_field()\n''\n```\n\nThe _min_ and _max_ attributes are created because you used the `Length`\nvalidator. And the field is marked _required_ because of the `InputRequired` validator. The field also gets a _title_ taken from the fields `description`.\n\nIf you validate the form and any errors pop up, the field would also get an\n_invalid_ attribute:\n\n```py\n>>> form.validate()\nFalse\n>>> form.test_field()\n''\n```\n\n\n## Install\n\nYou can install __WTForms HTML5__ with [pip][] or from source.\n\n### Install with pip\n\n[pip][] is _\"a tool for installing and managing Python packages\"_. If you don't\nhave it installed, see the [pip install instructions][].\n\n`pip install wtforms-html5`\n\n### Install from source\n\nYou can fetch the latest [sourceball][] from github and unpack it, or just\nclone this repository: `git clone git://github.com/brutus/wtforms-html5.git`.\nIf you got the source, change into the directory and use _setup.py_:\n\n`python setup.py install`\n\n### Install Requirements\n\nSince __WTForms HTML5__ only adds functionality to [WTForms][], you need to\nhave it installed too. But if you use the installation methods described\nabove, it should have been taken care of. Otherwise see the `requirements.txt`\nfile for a list.\n\n\n## Testing and Contribution\n\n__WTForms HTML5__ is at home at: https://github.com/brutus/wtforms-html5/\n\nIf you find any bugs, issues or anything, please use the [issue tracker][].\n\n### Testing\n\nThere are some __doctest__ in the module. You can run them from the _source\ndirectory_ like this: `python -m doctest wtforms_html5.py`. If you want to\nrun the __test cases__, run `python -m unittest discover` (also from the\n_source directory_).\n\nIf something fails, please get in touch.\n\n### Additional Requirements\n\nTo run the test cases a few additional requirements need to be fulfilled. You\ncan install all testing requirements like this: ``pip install -r\nrequirements/testing.txt``.\n\n\n\n[home]: https://github.com/brutus/wtforms-html5/\n[sourceball]: https://github.com/brutus/wtforms-html5/zipball/master\n[issue tracker]: https://github.com/brutus/wtforms-html5/issues\n\n[WTForms]: http://wtforms.simplecodes.com/\n[pip]: http://www.pip-installer.org/en/latest/index.html\n[pip install instructions]: http://www.pip-installer.org/en/latest/installing.html\n\n[badge-travis]: https://api.travis-ci.org/brutus/wtforms-html5.svg?branch=master\n[badge-landscape]: https://landscape.io/github/brutus/wtforms-html5/master/landscape.svg?style=flat\n[badge-coveralls]: https://coveralls.io/repos/github/brutus/wtforms-html5/badge.svg?branch=master\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/brutus/wtforms-html5/zipball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brutus/wtforms-html5/", "keywords": "", "license": "GNU GPLv3", "maintainer": "", "maintainer_email": "", "name": "wtforms-html5", "package_url": "https://pypi.org/project/wtforms-html5/", "platform": "", "project_url": "https://pypi.org/project/wtforms-html5/", "project_urls": { "Download": "https://github.com/brutus/wtforms-html5/zipball/master", "Homepage": "https://github.com/brutus/wtforms-html5/" }, "release_url": "https://pypi.org/project/wtforms-html5/0.2.2/", "requires_dist": [ "wtforms", "bumpversion; extra == 'dev'", "flake8; extra == 'dev'", "pylint; extra == 'dev'", "werkzeug; extra == 'test'", "beautifulsoup4; extra == 'test'" ], "requires_python": "", "summary": "Generates render keywords for widgets of WTForms HTML5 fields.", "version": "0.2.2" }, "last_serial": 2387052, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "632fb3294878082cf571a05db478704d", "sha256": "f532d67135c9ea86ec621011d295560e12f287840eb15f6a5f05924652b605f6" }, "downloads": -1, "filename": "wtforms-html5-0.1.3.tar.gz", "has_sig": false, "md5_digest": "632fb3294878082cf571a05db478704d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22366, "upload_time": "2012-11-12T13:51:37", "url": "https://files.pythonhosted.org/packages/ee/ec/7d72618c9d77232fd79015b82b866f123180fc86ea57cadb54d8cb9e0dff/wtforms-html5-0.1.3.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "976fa0fc097a0d37ba30c14f1c00c0fe", "sha256": "ea5d48187ada4390bb4af2ad9c99666626646a4a21f9b99cfabc1dd601d715a5" }, "downloads": -1, "filename": "wtforms_html5-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "976fa0fc097a0d37ba30c14f1c00c0fe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9103, "upload_time": "2016-10-07T18:31:01", "url": "https://files.pythonhosted.org/packages/71/01/9e5517917512894023fbc51e2c2a98cf86bbfa991217e8a10cb75301a82d/wtforms_html5-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1077fff8644cdbffb7314359d642995c", "sha256": "b284b7d3c10ae2591ccc43245ccbcfb4ae9ace8c17237a8b8bbd44444330b830" }, "downloads": -1, "filename": "wtforms-html5-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1077fff8644cdbffb7314359d642995c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20240, "upload_time": "2016-10-07T18:31:03", "url": "https://files.pythonhosted.org/packages/94/2d/b156754f5ba548abb3f643d8ab641bc0813928a993d30e1fe68aea7a524a/wtforms-html5-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "976fa0fc097a0d37ba30c14f1c00c0fe", "sha256": "ea5d48187ada4390bb4af2ad9c99666626646a4a21f9b99cfabc1dd601d715a5" }, "downloads": -1, "filename": "wtforms_html5-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "976fa0fc097a0d37ba30c14f1c00c0fe", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9103, "upload_time": "2016-10-07T18:31:01", "url": "https://files.pythonhosted.org/packages/71/01/9e5517917512894023fbc51e2c2a98cf86bbfa991217e8a10cb75301a82d/wtforms_html5-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1077fff8644cdbffb7314359d642995c", "sha256": "b284b7d3c10ae2591ccc43245ccbcfb4ae9ace8c17237a8b8bbd44444330b830" }, "downloads": -1, "filename": "wtforms-html5-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1077fff8644cdbffb7314359d642995c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20240, "upload_time": "2016-10-07T18:31:03", "url": "https://files.pythonhosted.org/packages/94/2d/b156754f5ba548abb3f643d8ab641bc0813928a993d30e1fe68aea7a524a/wtforms-html5-0.2.2.tar.gz" } ] }