{ "info": { "author": "Nathan Van Gheem", "author_email": "vangheem@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Programming Language :: Python" ], "description": "Introduction\n============\n\ncollective.wtforms is plone integration with the `WTForms`__ form library.\n\n__ http://packages.python.org/WTForms/\n\nBasic Complete Form Example\n---------------------------\n\nThe basic form is constructed like so::\n\n from wtforms import Form, TextField\n from wtforms import validators\n class MyForm(Form):\n one = TextField(\"Field One\", [validators.required()])\n two = TextField(\"Field Two\")\n three = TextField(\"Field Three\")\n\n from collective.wtforms.views import WTFormView\n class MyFormView(WTFormView):\n formClass = MyForm\n buttons = ('Create', 'Cancel')\n\n def submit(self, button):\n if button == 'Create' and self.validate():\n # do fun stuff here\n self.context.value = self.form.one.data\n\nThen wire up the form with zcml::\n \n \n\n\nYou can also override the template used and then do::\n\n
\n\nTo render the form anywhere in your view.\n\n\nFieldsets\n---------\n\nYou can specific which fields go with which fieldsets\neasily also::\n\n class MyFormView(WTFormView):\n formClass = MyForm\n buttons = ('Create', 'Cancel')\n fieldsets = (\n ('Fieldset One', ('one', 'two')),\n ('Fieldset Two', ('three',))\n )\n\n def submit(self, button):\n if button == 'Create' and self.validate():\n # do fun stuff here\n self.context.value = self.form.one.data\n\nThis will render the form in the standard plone feildsets.\n\n\nControl Panel\n-------------\n\nIt's also possible to easily construct a control panel form::\n\n from collective.wtforms.views import WTFormControlPanelView\n class MyFormView(WTFormControlPanelView):\n formClass = MyForm\n buttons = ('Save', 'Cancel')\n\n def submit(self, button):\n if button == 'Save' and self.validate():\n # do fun stuff here\n self.context.value = self.form.one.data\n\nWTFormView Class Properties\n---------------------------\n\nformClass\n The WTForm class used. `Required`\n\nlabel\n The form label that shows up in the h1 tag\n\ndescription\n form description\n\nprefix\n The prefix of the form input name values. Defaults to `wtform`\n\nbuttonPrefix\n The prefix of the button names. Defaults to `form.actions.`\n\nwrapWithFieldset\n A boolean that decides if it should wrap the fields in a fieldset. Defaults to True\n\ncsrfProtect\n Protect the form against csrf attacks. Defaults to True\n\nbuttons\n An iterable of button names. Defaults to ('Save', 'Cancel')\n\nfieldsets\n An iterable of (fieldset name, (field names, ...)). Defaults to empty\n\nform\n The instance of the WTForm form that is created on rendering the form.\n\ndata\n Override this property to specify default values to populate the form with. This must return a dictionary.\n\nsubmitted\n Boolean if the form was submitted or not.\n\nrenderField(field)\n Method to render a specific field.\n\nrenderForm()\n Method to render the entire form.\n\nvalidate()\n Check csrf protection and validates the form.\n\nsubmit(button)\n The method you must override to handle the form sumission and run validation. Return a value to override rendering the template(self.index()). For instance, if you do a redirect, there is no need to render the page also::\n\n def submit(self, button):\n if button == 'Save' and self.validate():\n self.context.value = self.form.one.data\n self.request.response.redirect(self.context.absolute_url())\n return 1\nmungeForm(form)\n A method to mess with the form after it is created. This is what can be used to apply dynamic choices.\n\nChangelog\n=========\n\n1.0a6 (2012-11-26)\n------------------\n\n- handle spaces in button names\n [vangheem]\n\n\n1.0a5 (2012-11-26)\n------------------\n\n- handle unicode data\n [vangheem]\n\n- do not use and display dummy default form title and description\n\n- moved the field description after label, where commonly is\n\n- added locales directory, for being able to translate basic default buttons\n\n- provided italian translation\n\n- enabled the Plone form tabbing feature\n\n\n1.0a4 (2012-08-29)\n------------------\n\n- provide some bootstrap class hints\n\n\n1.0a3 (2011-10-11)\n------------------\n\n- fix issue where initial form data wouldn't work\n in some instances.\n\n\n1.0a2 (2011-10-06)\n------------------\n\n- Fixed control panel template used.\n\n- add ability to easily mess with form after creation\n\n- add ability to provide initial data to form values\n\n\n1.0a1 (2011-09-29)\n------------------\n\n- Initial 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/collective/collective.wtforms", "keywords": "forms plone wtforms", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.wtforms", "package_url": "https://pypi.org/project/collective.wtforms/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.wtforms/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/collective/collective.wtforms" }, "release_url": "https://pypi.org/project/collective.wtforms/1.0a6/", "requires_dist": null, "requires_python": null, "summary": "Plone wtforms integration", "version": "1.0a6" }, "last_serial": 788280, "releases": { "1.0a1": [ { "comment_text": "", "digests": { "md5": "83e78271531cbb937f0419fa2432ded1", "sha256": "1ceb66bb0cd5ecd2c7f8548442584cbbc1d880681e62a5086e7070192e91e319" }, "downloads": -1, "filename": "collective.wtforms-1.0a1.zip", "has_sig": false, "md5_digest": "83e78271531cbb937f0419fa2432ded1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23711, "upload_time": "2011-09-29T19:40:31", "url": "https://files.pythonhosted.org/packages/8a/58/fa9724f06d2b0a327d4307e235744e0697b1237f742c57ca4698bc961446/collective.wtforms-1.0a1.zip" } ], "1.0a2": [ { "comment_text": "", "digests": { "md5": "eda50e8f1339458282d3b704100939fe", "sha256": "e08c7e30420d00630a8bb194e22612e354a39d5504a6b2c5113e8f357ad2e61e" }, "downloads": -1, "filename": "collective.wtforms-1.0a2.zip", "has_sig": false, "md5_digest": "eda50e8f1339458282d3b704100939fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24672, "upload_time": "2011-10-06T19:59:35", "url": "https://files.pythonhosted.org/packages/8c/9e/c24d33fd6a2f073366911fb85e27a43458c4f867098cdf93b3c3dc138c70/collective.wtforms-1.0a2.zip" } ], "1.0a3": [ { "comment_text": "", "digests": { "md5": "6574ad2eb1d947940afb3b5f0818387c", "sha256": "8936fc6a945d8836bfe5bf78b61209d220c275ed81f110febf3d9337aabd8f64" }, "downloads": -1, "filename": "collective.wtforms-1.0a3.zip", "has_sig": false, "md5_digest": "6574ad2eb1d947940afb3b5f0818387c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24829, "upload_time": "2011-10-12T06:24:20", "url": "https://files.pythonhosted.org/packages/c9/88/78860b56550677a1b03a5e597266aa4c4a042089d33a11386b3fc77183d9/collective.wtforms-1.0a3.zip" } ], "1.0a4": [ { "comment_text": "", "digests": { "md5": "53339c2bf334beddbb731947c0c011a6", "sha256": "dc6f20077acae3fff3b21d2df62b76e73e4c2377b0c5e458042ea058dcad1422" }, "downloads": -1, "filename": "collective.wtforms-1.0a4.zip", "has_sig": false, "md5_digest": "53339c2bf334beddbb731947c0c011a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24978, "upload_time": "2012-08-29T22:17:07", "url": "https://files.pythonhosted.org/packages/5b/4a/907227e3981eaa1081762f39198ce237612f58b7e9cb6a2d26f60ec198e1/collective.wtforms-1.0a4.zip" } ], "1.0a5": [ { "comment_text": "", "digests": { "md5": "069dd0fd62ac750185c1fee61cb8e9cd", "sha256": "decce6b2eb510549fbbd1f5b76fd1a2ddbed75b8cc28250b26babc05875d7502" }, "downloads": -1, "filename": "collective.wtforms-1.0a5.zip", "has_sig": false, "md5_digest": "069dd0fd62ac750185c1fee61cb8e9cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30578, "upload_time": "2012-11-26T22:31:36", "url": "https://files.pythonhosted.org/packages/dd/19/0df7845c5758ba44f32c562bd26f1f58c2e3e6c8112fb1e914dcd985cac4/collective.wtforms-1.0a5.zip" } ], "1.0a6": [ { "comment_text": "", "digests": { "md5": "a8e7bb4890450e8c71d2c8b414ff0217", "sha256": "8c6caa66541d2d9b88afedcd691100cc5e106122d8de239ef0726c6a34b446d2" }, "downloads": -1, "filename": "collective.wtforms-1.0a6.zip", "has_sig": false, "md5_digest": "a8e7bb4890450e8c71d2c8b414ff0217", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30666, "upload_time": "2012-11-26T23:13:41", "url": "https://files.pythonhosted.org/packages/b7/d8/e4b4cebb36c58cb2dcf4f34c41aeda25d93ec37a95fb512ae7a204859343/collective.wtforms-1.0a6.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a8e7bb4890450e8c71d2c8b414ff0217", "sha256": "8c6caa66541d2d9b88afedcd691100cc5e106122d8de239ef0726c6a34b446d2" }, "downloads": -1, "filename": "collective.wtforms-1.0a6.zip", "has_sig": false, "md5_digest": "a8e7bb4890450e8c71d2c8b414ff0217", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30666, "upload_time": "2012-11-26T23:13:41", "url": "https://files.pythonhosted.org/packages/b7/d8/e4b4cebb36c58cb2dcf4f34c41aeda25d93ec37a95fb512ae7a204859343/collective.wtforms-1.0a6.zip" } ] }