{
"info": {
"author": "Martin Koistinen",
"author_email": "mkoistinen@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 1.10",
"Framework :: Django :: 1.11",
"Framework :: Django :: 1.8",
"Framework :: Django :: 1.9",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Communications",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content"
],
"description": "======================\nCMSPlugin Form Handler\n======================\n\n|PyPI Version| |Build Status| |Coverage Status|\n\n.. |PyPI Version| image:: http://img.shields.io/pypi/v/cmsplugin-form-handler.svg\n :target: https://pypi.python.org/pypi/cmsplugin-form-handler\n.. |Build Status| image:: http://img.shields.io/travis/mkoistinen/cmsplugin-form-handler/master.svg\n :target: https://travis-ci.org/mkoistinen/cmsplugin-form-handler\n.. |Coverage Status| image:: http://img.shields.io/coveralls/mkoistinen/cmsplugin-form-handler/master.svg\n :target: https://coveralls.io/r/mkoistinen/cmsplugin-form-handler?branch=master\n\n\nThis package provides a mechanism for handling form-submissions in\ndjango-CMS plugins.\n\nJump to `Quickstart`_ below to get started, or see the proper\n`documentation `_.\n\n---------------------\nBackground & Approach\n---------------------\n\n.. Avoid non-standard directives (like those from Sphinx) here, as this file is\n also `include`d in the project's README.txt file.\n\nBackground\n----------\n\nPlugins are a key component of `django CMS `_ for\ncreating reusable, configurable content fragments in django CMS projects. Due to\ntheir flexibility and utility, project developers would benefit from emitting\nforms and handling form submissions using plugins.\n\nSince CMS plugins are fragments of a page, they do not provide a unique, URL for\nreceiving and handling form submissions. This presents numerous challenges when\nattempting to process form submissions.\n\n\nApproach\n--------\n\nTo get around these limitations, the approach taken in this package is to direct\nform submissions from plugins which sub-class ``FormPluginBase`` to a URL that\nis outside of the django CMS URL-space and handled by a ``ProcessFormView``\nprovided by this package.\n\nThe ``ProcessFormView`` accepts form-submissions, processes them, and if valid,\nsends the resulting form back to the plugin class for handling and then responds\nto the request with a redirect to a ``success_url`` provided by the plugin.\n\nOn validation errors, the view will redirect the request back to the originating\npage and provide the form data via a session variable back to the plugin's form.\n\nThe user experience is precisely as expected and the handling of the form is\nperformed without \"thrown HTTPRedirectResponses\" or any special middleware.\n\nThis package encapsulates all extra logic so that the plugin developer need\nonly to subclass ``FormPluginBase`` rather than the usual\n``cms.plugin_base.CMSPluginBase``.\n\nThe ``Form`` or ``ModelForm`` presented in the CMS plugin should also include\nthe \"mixin\" ``FormPluginFormMixin``.\n\n\n----------\nQuickstart\n----------\n\n.. Avoid non-standard directives (like those from Sphinx) here, as this file is\n also `include`d in the project's README.txt file.\n\nTo get started quickly, first install the package: ::\n\n pip install cmsplugin-form-handler\n\nAdd the package to ``settings.INSTALLED_APPS``: ::\n\n # my_cool_project/settings.py\n\n INSTALLED_APPS = (\n ...\n 'cmsplugin_form_handler',\n )\n\nAdd an extra line in your url configuration: ::\n\n urlpatterns = i18n_patterns('',\n url(r'^admin/', include(admin.site.urls)),\n ...\n url(r'^plugin_forms/', include('cmsplugin_form_handler.urls',\n namespace='cmsplugin_form_handler')),\n url(r'^', include('cms.urls')),\n )\n\n\nAdd the ``FormPluginFormMixin`` mixin to your ``Form``: ::\n\n # my_cool_project/forms.py\n\n from django import forms\n from cmsplugin_form_handler.forms import FormPluginFormMixin\n\n class MyCoolForm(FormPluginFormMixin, forms.Form):\n # everything else is your normal form.\n my_cool_field = forms.CharField(...)\n ...\n\nOr, if you're using a ``ModelForm``: ::\n\n # my_cool_project/forms.py\n\n from django import forms\n from cmsplugin_form_handler.forms import FormPluginFormMixin\n\n class MyCoolModelForm(FormPluginFormMixin, forms.ModelForm):\n # everything else is your normal form.\n class Meta:\n model = MyCoolModel\n ...\n\nSubclass your cms plugin from ``FormPluginBase``: ::\n\n # my_cool_project/cms_plugins.py\n\n from cmsplugin_form_handler.cms_plugins import FormPluginBase\n\n class MyCoolPlugin(FormPluginBase):\n # Use your normal CMSPlugin attributes...\n render_template = 'plugins/my_cool_plugin.html'\n # Note that ``cache = False`` will automatically be set\n\n # These should be overridden in sub-classes\n form_class = MyCoolForm # Or, see: get_form_class()\n success_url = '/static/success/url/here' # Or, see: get_success_url()\n\n def render(self, context, instance, placeholder):\n context = super(MyCoolPlugin, self).render(context, instance, placeholder)\n\n # Do your normal thing here\n ...\n\n return context\n\n def get_form_class(self, request, instance):\n # Use this method to programmatically determine the form_class.\n # This is what this method does by default:\n return self.form_class\n\n def get_success_url(self, request, instance):\n # Use this method to programmatically determine the success_url.\n # This is what this method does by default:\n return self.success_url\n\n def form_valid(self, request, instance, form):\n # Optionally do something with the rendered form here\n # This is what this method does by default:\n form.save()\n\n\nFinally, update your plugin's template: ::\n\n # my_cool_project/templates/plugins/my_cool_plugin.html\n\n {% load cmsplugin_form_tags %}\n\n Form Plugin
\n \n\n\n",
"description_content_type": null,
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/mkoistinen/cmsplugin-form-handler",
"keywords": "",
"license": "LICENSE.txt",
"maintainer": "",
"maintainer_email": "",
"name": "cmsplugin-form-handler",
"package_url": "https://pypi.org/project/cmsplugin-form-handler/",
"platform": "OS Independent",
"project_url": "https://pypi.org/project/cmsplugin-form-handler/",
"project_urls": {
"Homepage": "https://github.com/mkoistinen/cmsplugin-form-handler"
},
"release_url": "https://pypi.org/project/cmsplugin-form-handler/0.2.0/",
"requires_dist": [
"django-cms (>=3.1)"
],
"requires_python": "",
"summary": "Easy plugin forms for django CMS",
"version": "0.2.0"
},
"last_serial": 3270729,
"releases": {
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "f577b6a6d721bb1fed4d8ddf45776ea4",
"sha256": "05563cf182a26d487fbc601609f9084cc0bf495148e3a3cf3497ee36116b1156"
},
"downloads": -1,
"filename": "cmsplugin_form_handler-0.1.1-py2-none-any.whl",
"has_sig": false,
"md5_digest": "f577b6a6d721bb1fed4d8ddf45776ea4",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 10676,
"upload_time": "2016-04-25T03:15:50",
"url": "https://files.pythonhosted.org/packages/97/76/324a619f1c079b522e0e9d6b43689e776c801d7ea5a872fb7e506b07eb4e/cmsplugin_form_handler-0.1.1-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "258308161d1e79b8adbada3d7cff5547",
"sha256": "79e4d9b8a7e4b8dd1f2cca0a968bb670663966bd19a590e5c05c7c28f35e31c2"
},
"downloads": -1,
"filename": "cmsplugin-form-handler-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "258308161d1e79b8adbada3d7cff5547",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 493941,
"upload_time": "2016-04-25T03:15:36",
"url": "https://files.pythonhosted.org/packages/38/75/a9a51d561ca753b11c166e8fb4b5231ca9f8574729de37546afb33f68456/cmsplugin-form-handler-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "daa6f9e9e58bbfa6d559c6f999a34a99",
"sha256": "c8293aac76b67349c339da6ba84f68039dc1414aaadda1035c249450cd81687d"
},
"downloads": -1,
"filename": "cmsplugin_form_handler-0.1.2-py2-none-any.whl",
"has_sig": false,
"md5_digest": "daa6f9e9e58bbfa6d559c6f999a34a99",
"packagetype": "bdist_wheel",
"python_version": "2.7",
"requires_python": null,
"size": 10802,
"upload_time": "2016-04-25T03:45:19",
"url": "https://files.pythonhosted.org/packages/a6/6a/c7bf8a6f5e3b87af49e76419b95909af28d4216455728d2d1faeb783e1b0/cmsplugin_form_handler-0.1.2-py2-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "c5adf26510c97ed4818cc4e14c575253",
"sha256": "f7d545b9fbd84a3adcd5d8316f3830befee9645322531e9470a40ab71647d3d3"
},
"downloads": -1,
"filename": "cmsplugin-form-handler-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "c5adf26510c97ed4818cc4e14c575253",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1157354,
"upload_time": "2016-04-25T03:44:58",
"url": "https://files.pythonhosted.org/packages/be/b5/4f91ef4c17e353c233d1d6ddb86d5d64c2dd71511bf3b3b1487eaa430b0c/cmsplugin-form-handler-0.1.2.tar.gz"
}
],
"0.1.3": [
{
"comment_text": "",
"digests": {
"md5": "8b3e14160401fed0665282809f078845",
"sha256": "7f99cee67605ef72a94d9e120f1403bcb556887c2683b0863d3787d659742043"
},
"downloads": -1,
"filename": "cmsplugin-form-handler-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "8b3e14160401fed0665282809f078845",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1162391,
"upload_time": "2016-12-06T16:50:04",
"url": "https://files.pythonhosted.org/packages/7a/31/0c5e12f7149a228ebf7dd968e3b279718d5ddc4afe689814f7db91f61850/cmsplugin-form-handler-0.1.3.tar.gz"
}
],
"0.2.0": [
{
"comment_text": "",
"digests": {
"md5": "c3308a17e0129e40aef313bd66cbedd0",
"sha256": "8edd4f2c9f2a3a53b8aab16db5a523e451e8f87e534c5603e3fb10f281746a2f"
},
"downloads": -1,
"filename": "cmsplugin_form_handler-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c3308a17e0129e40aef313bd66cbedd0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21394,
"upload_time": "2017-10-23T00:14:35",
"url": "https://files.pythonhosted.org/packages/c6/88/5ba0493a3cb8bb7c0b57a5cd074902906a09a17888c10cbb4111820706d7/cmsplugin_form_handler-0.2.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b8d43d4263f39303b489027de926032f",
"sha256": "1331add5e0d221da0fdacffab822b0d3bdc6ec9016344e7a4d793be0cc5e62e6"
},
"downloads": -1,
"filename": "cmsplugin-form-handler-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b8d43d4263f39303b489027de926032f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1170198,
"upload_time": "2017-10-23T00:14:44",
"url": "https://files.pythonhosted.org/packages/31/20/34f457eda82dc370cd9e8aa40790d25c353194e994435ea5f1079f5b0014/cmsplugin-form-handler-0.2.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "c3308a17e0129e40aef313bd66cbedd0",
"sha256": "8edd4f2c9f2a3a53b8aab16db5a523e451e8f87e534c5603e3fb10f281746a2f"
},
"downloads": -1,
"filename": "cmsplugin_form_handler-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c3308a17e0129e40aef313bd66cbedd0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 21394,
"upload_time": "2017-10-23T00:14:35",
"url": "https://files.pythonhosted.org/packages/c6/88/5ba0493a3cb8bb7c0b57a5cd074902906a09a17888c10cbb4111820706d7/cmsplugin_form_handler-0.2.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b8d43d4263f39303b489027de926032f",
"sha256": "1331add5e0d221da0fdacffab822b0d3bdc6ec9016344e7a4d793be0cc5e62e6"
},
"downloads": -1,
"filename": "cmsplugin-form-handler-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b8d43d4263f39303b489027de926032f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1170198,
"upload_time": "2017-10-23T00:14:44",
"url": "https://files.pythonhosted.org/packages/31/20/34f457eda82dc370cd9e8aa40790d25c353194e994435ea5f1079f5b0014/cmsplugin-form-handler-0.2.0.tar.gz"
}
]
}