{ "info": { "author": "Alessandro Molina", "author_email": "alessandro.molina@axant.it", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: TurboGears", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "About Ajax Forms\n-------------------------\n\ntgext.ajaxforms makes quick and easy to create ajax loaded and submitted forms in TurboGears2\napplications.\n\nTo make a form ajax based just apply the **ajaxforms.ajaxloaded** decorator to any ToscaWidgets\nform and declare a *ajaxurl* variable to specify the method that loads the form. \nThe method can be automatically generated or hand-written. \nBy default ajax validation is automatically supported.\n\nInstalling\n-------------------------------\n\ntgext.ajaxform can be installed both from pypi or from bitbucket::\n\n easy_install tgext.ajaxforms\n\nshould just work for most of the users\n\nMaking an Ajax Form\n----------------------------------\n\nThe form itself can be any ToscaWidgets form, the only required additions\nare to apply the **@ajaxloaded** decorator to the form itself and\nspecify the **ajaxurl** of the form that will point to the related\ncontroller method::\n\n from tgext.ajaxforms import ajaxloaded\n\n @ajaxloaded\n class TestForm(twf.TableForm):\n class fields(WidgetsList):\n name = twf.TextField('Name', validator=validators.String(not_empty=True))\n surname = twf.TextField('Surname', validator=validators.String(not_empty=True))\n\n ajaxurl = '/form_show'\n action = '/form_submit' \n submit_text = \"GO\"\n test_form = TestForm()\n\n\nShowing The Form\n----------------------------------\n\nTo show the form it is necessary to add a controller method bound to the **ajaxurl**\nparameter of the form that will display the form itself and that will be used\nby ajaxform each time that it has to display the form. For most cases this\nmethod can be generated by using the **ajaxform** call.\nAlso you have to create a page where the form will be loaded. \n\nFor example to show the form in the index page having *ajaxurl = '/form_show'*::\n\n from tgext.ajaxforms import ajaxform \n\n class RootController(BaseController): \n form_show = ajaxform(test_form)\n\n @expose('myapp.templates.index')\n def index(self):\n return dict(form=test_form)\n\nThe *myapp.templates.index* template should look the usual template\nthat you would use to display a ToscaWidgets based form::\n\n \n \n \n \n Ajax Form Test Example\n \n \n
\n ${form(name='HI')}\n
\n \n \n\n\nHandling Submit and Validation\n-------------------------------\n\nSubmit and validation should look the same that you would use for any ToscaWidgets\nform, simply using the **ajaurl** bound method as an error_handler::\n\n class RootController(BaseController): \n @expose()\n @validate(test_form, error_handler=form_show)\n def form_submit(self, **kw):\n return 'Thanks: {name} {surname}'.format(**kw)\n\nComplete Example\n----------------------------\n\n\nmyapp.templates.index::\n\n \n \n \n \n Ajax Form Test Example\n \n \n
\n ${form(name='HI')}\n
\n \n \n\nmyapp.controllers.root::\n\n from tgext.ajaxforms import ajaxloaded, ajaxform\n\n @ajaxloaded\n class TestForm(twf.TableForm):\n class fields(WidgetsList):\n name = twf.TextField('Name', validator=validators.String(not_empty=True))\n surname = twf.TextField('Surname', validator=validators.String(not_empty=True))\n\n ajaxurl = '/form_show'\n action = '/form_submit' \n submit_text = \"GO\"\n test_form = TestForm()\n\n class RootController(BaseController): \n form_show = ajaxform(test_form)\n\n @expose('myapp.templates.index')\n def index(self):\n return dict(form=test_form)\n\n @expose()\n @validate(test_form, error_handler=form_show)\n def form_submit(self, **kw):\n return 'Thanks: {name} {surname}'.format(**kw)\n\n\n\nShowing the Form on Demand\n------------------------------\n\nAjaxForm since version 0.1.2 supports on demand display of forms.\nThis permits to show a form when a javascript event happens.\n\nTo do this, you must use ``form.on_demand()`` instead of ``form()`` to\ndisplay the form inside the template. This will create a javascript\nfunction named: ``FormClassName_on_demand(where, params)`` the ``where``\nargument is any valid selector where to display the form, while the\nparams method is a dictionary with the arguments that have to be sent\nto the backend. By default any argument specified inside the params\ndictionary will be used to fill the form fields.\n\nFor example, to display on demand this form::\n\n @ajaxloaded\n class TryAjax(TableForm):\n class fields(WidgetsList):\n field1 = TextField(validator=validators.String(not_empty=True))\n field2 = TextField(validator=validators.String(not_empty=True))\n action = '/dosomething'\n ajaxurl = '/TryAjax_show'\n ajax_test = TryAjax()\n\nYour template might look like this::\n\n
\n ${form.on_demand()}\n
Show Form
\n
", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/_amol_/tgext.ajaxforms", "keywords": "turbogears2.extension", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "tgext.ajaxforms", "package_url": "https://pypi.org/project/tgext.ajaxforms/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tgext.ajaxforms/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/_amol_/tgext.ajaxforms" }, "release_url": "https://pypi.org/project/tgext.ajaxforms/0.3.2/", "requires_dist": null, "requires_python": null, "summary": "Makes easier to create AJAX forms in TurboGears2", "version": "0.3.2" }, "last_serial": 2354535, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "bf05469bf4db45a2338eee49de983dd8", "sha256": "2eb84dc4f35be4e479cc2e9d9b03ab3605b2fc6896f588d8d576629d6c825e5d" }, "downloads": -1, "filename": "tgext.ajaxforms-0.1.tar.gz", "has_sig": false, "md5_digest": "bf05469bf4db45a2338eee49de983dd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16160, "upload_time": "2011-06-26T14:13:35", "url": "https://files.pythonhosted.org/packages/0c/4e/af1491ecf3c0567988a2dd068843559a84c6e26f22dfa8cef79aaf59aa7a/tgext.ajaxforms-0.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "90c92200992a80480ba4071c22faa545", "sha256": "5f1eb38015acad9a69f1f7e76aa800d1fe2ea709c9a2468cf9f4523487be22fb" }, "downloads": -1, "filename": "tgext.ajaxforms-0.1.2.tar.gz", "has_sig": false, "md5_digest": "90c92200992a80480ba4071c22faa545", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16512, "upload_time": "2011-09-12T00:57:31", "url": "https://files.pythonhosted.org/packages/c2/40/33bde983337c5481fc2df99d71621a188f8d3d92ec1007f208d22268b098/tgext.ajaxforms-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "62aacd0f22ed12d591390f390bb0dccd", "sha256": "13956486deaa37f14f7be60eee3c55a83ff95c712e4c1b85cab2474da88ea9cd" }, "downloads": -1, "filename": "tgext.ajaxforms-0.1.3.tar.gz", "has_sig": false, "md5_digest": "62aacd0f22ed12d591390f390bb0dccd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16520, "upload_time": "2011-09-12T12:11:29", "url": "https://files.pythonhosted.org/packages/92/17/159247b3bc7c24c64c7e4586ea9be7bf6e5dc36c67bb223d766a5f6f0a4b/tgext.ajaxforms-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6ac6426b12b8bef8d63d852803533a12", "sha256": "584b6918a9c8049f1fc2e491661683ed623f556b315b9513ca6cdd1d809df1da" }, "downloads": -1, "filename": "tgext.ajaxforms-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6ac6426b12b8bef8d63d852803533a12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17368, "upload_time": "2012-09-05T20:15:53", "url": "https://files.pythonhosted.org/packages/f7/02/48bcfc47bb7979ec5704f84d69020622b11a222619eae388277f8eaaadc1/tgext.ajaxforms-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "fa392858ed8b601c2103d49f70ec2d59", "sha256": "403681cac136f0837d4a5486b8bef6117ea0c6bbfba92f9a60d81a723f3fc901" }, "downloads": -1, "filename": "tgext.ajaxforms-0.2.1.tar.gz", "has_sig": false, "md5_digest": "fa392858ed8b601c2103d49f70ec2d59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26898, "upload_time": "2012-10-02T22:36:52", "url": "https://files.pythonhosted.org/packages/67/8b/47e9a84a4e9fe2e8b5f27bf4e8b07a21aa3615dcd968aaa2d59bf213117f/tgext.ajaxforms-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "84f884a9f50a821310fa0b83d7281710", "sha256": "39961a8133a71c9df98296958c7f2b2883db2cc5a2505007e2a9a132d3a99337" }, "downloads": -1, "filename": "tgext.ajaxforms-0.3.0.tar.gz", "has_sig": false, "md5_digest": "84f884a9f50a821310fa0b83d7281710", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52625, "upload_time": "2016-07-10T07:54:47", "url": "https://files.pythonhosted.org/packages/33/62/254dec25b4ce83d9fe3b8820737ee9a68d4fd60c7ca888fcbde86f09dc05/tgext.ajaxforms-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "7a41e16d6eed3245ee2ccfd986c36003", "sha256": "a4169fcc76050fd15b1f09b786869f1dfdc4e21ebb9e847c5ff33db0900cf84b" }, "downloads": -1, "filename": "tgext.ajaxforms-0.3.1.tar.gz", "has_sig": false, "md5_digest": "7a41e16d6eed3245ee2ccfd986c36003", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52672, "upload_time": "2016-07-10T08:35:15", "url": "https://files.pythonhosted.org/packages/3c/20/e72d97adf7ebd8d4da8cdef168144b05ea904fb4829a40b2a946bbb77b8e/tgext.ajaxforms-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "01e1c0240dcce110833c7e94e31bfd3f", "sha256": "20aeb38d186e25396f83f5468bf06a2d4508321d3834b80a7d48833bafd9d75b" }, "downloads": -1, "filename": "tgext.ajaxforms-0.3.2.tar.gz", "has_sig": false, "md5_digest": "01e1c0240dcce110833c7e94e31bfd3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52709, "upload_time": "2016-09-21T08:35:57", "url": "https://files.pythonhosted.org/packages/61/35/b4e95f3c08156b98d12d42b8dac919b2c3fc0645c47e29386764050b967d/tgext.ajaxforms-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "01e1c0240dcce110833c7e94e31bfd3f", "sha256": "20aeb38d186e25396f83f5468bf06a2d4508321d3834b80a7d48833bafd9d75b" }, "downloads": -1, "filename": "tgext.ajaxforms-0.3.2.tar.gz", "has_sig": false, "md5_digest": "01e1c0240dcce110833c7e94e31bfd3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52709, "upload_time": "2016-09-21T08:35:57", "url": "https://files.pythonhosted.org/packages/61/35/b4e95f3c08156b98d12d42b8dac919b2c3fc0645c47e29386764050b967d/tgext.ajaxforms-0.3.2.tar.gz" } ] }