|Project continuation| |Pypi package| |Pypi status| |Python versions| |License|
================
Aldryn Forms App
================
Continuation of the deprecated project `Divio Aldryn Forms <https://github.com/divio/aldryn-forms>`_.
Aldryn Forms allows you to build flexible HTML forms for your `Aldryn <http://aldryn.com>`_ and `django CMS
<http://www.django-cms.org>`_ projects, and to integrate them directly in your pages.
Forms can be assembled using the form builder, with the familiar simple drag-and-drop interface of the django CMS
plugin system.
Submitted data is stored in the Django database, and can be explored and exported using the admin, while forms can
be configured to send a confirmation message to users.
Contributing
============
This is a an open-source project. We'll be delighted to receive your
feedback in the form of issues and pull requests. Before submitting your
pull request, please review our `contribution guidelines
<http://docs.django-cms.org/en/latest/contributing/index.html>`_.
We're grateful to all contributors who have helped create and maintain this package.
Contributors are listed at the `contributors <https://github.com/divio/aldryn-forms/graphs/contributors>`_
section.
Installation
============
Aldryn Platform Users
---------------------
Choose a site you want to install the add-on to from the dashboard. Then go to ``Apps -> Install app`` and click ``Install`` next to ``Forms`` app.
Redeploy the site.
Upgrading from < 2.0
====================
Version 2.0 introduced a new model for form data storage called ``FormSubmission``.
The old ``FormData`` model has been deprecated.
Although the ``FormData`` model's data is still accessible through the admin, all new form data will be stored in the new
``FormSubmission`` model.
Manuall Installation
--------------------
Run ``pip install djangocms-aldryn-forms``.
Update ``INSTALLED_APPS`` with ::
INSTALLED_APPS = [
...
'aldryn_forms',
'aldryn_forms.contrib.email_notifications',
'captcha',
...
]
Also ensure you define an `e-mail backend <https://docs.djangoproject.com/en/dev/topics/email/#dummy-backend>`_ for your app.
Creating a Form
===============
You can create forms in the admin interface now. Search for the label ``Aldryn_Forms``.
Create a CMS page and install the ``Forms`` app there (choose ``Forms`` from the ``Advanced Settings -> Application`` dropdown).
Now redeploy/restart the site again.
The above CMS site has become a forms POST landing page - a place where submission errors get displayed if there are any.
Available Plug-ins
==================
- ``FormPlugin`` plugin lets you embed certain forms on a CMS page.
- ``Fieldset`` groups fields.
- ``TextField`` renders text input.
- ``TextAreaField`` renders text input.
- ``HiddenField``
- ``PhoneField``
- ``DateField``
- ``DateTimeLocalField``
- ``TimeField``
- ``NumberField``
- ``EmailField``
- ``FileField`` renders a file upload input.
- ``MultipleFilesField``
- ``ImageField`` same as ``FileField`` but validates that the uploaded file is an image.
- ``BooleanField`` renders checkbox.
- ``SelectField`` renders single select input.
- ``MultipleSelectField``
- ``MultipleCheckboxSelectField`` renders multiple checkboxes.
- ``CaptchaField``
- ``HideContentWhenPostPlugin``
Middleware
==========
Dispatch submitted form by middleware. If the HTTP header ``HTTP_X_REQUESTED_WITH`` is ``XMLHttpRequest`` a json response is returned.
Write in settings.py: ::
MIDDLEWARE = [
...
"aldryn_forms.middleware.handle_post.HandleHttpPost"
]
Saving to the same post
=======================
Activation of repeated saving to the same post.
Write in settings.py: ::
# Send email after 30 minutes. Remove post_ident after 30 minutes.
ALDRYN_FORMS_MULTIPLE_SUBMISSION_DURATION = 30
After this entry, the ``post_ident`` parameter is added to the success url for redirection. For example ::
/thank-you/?post_ident=HErQ2TunSAU0AhTKrNSVDtSVBoYr9gTvUCUsdpMg6AZVqzExXCK06Tm7XIznf1sw
Submit form by javascript
=========================
Activating form submission via javascript ``fetch``: Add class ``submit-by-fetch`` into element ``form``.
Example: ::
<form class="submit-by-fetch">
...
</form>
Run next submit
===============
Use the ``Form with Ident field`` plugin in the administration.
In the ``run_next`` dataset parameter, enter the name of the function to be executed after receiving the response
from javascript ``fetch`` command.
Example: ::
<form data-run_next="runNext">
...
</form>
Example of ``runNext`` javascript function: ::
function runNext(form, data) {
...
for (const input of document.querySelectorAll('input.aldryn-forms-field-ident')) {
input.value = data.post_ident
}
...
}
Commands
========
The command ``aldryn_forms_remove_expired_post_idents`` deletes the ``post_ident`` values for all records older than the value in ``ALDRYN_FORMS_MULTIPLE_SUBMISSION_DURATION``.
The command ``aldryn_forms_send_emails`` will send all emails that are waiting to be sent.
Add these commands to crontab: ::
1/10 * * * * django-admin aldryn_forms_remove_expired_post_idents
1/10 * * * * django-admin aldryn_forms_send_emails
.. |Project continuation| image:: https://img.shields.io/badge/Continuation-Divio_Aldryn_Froms-blue
:target: https://github.com/CZ-NIC/djangocms-aldryn-forms
:alt: Continuation of the deprecated project "Divio Aldryn forms"
.. |Pypi package| image:: https://img.shields.io/pypi/v/djangocms-aldryn-forms.svg
:target: https://pypi.python.org/pypi/djangocms-aldryn-forms/
:alt: Pypi package
.. |Pypi status| image:: https://img.shields.io/pypi/status/djangocms-aldryn-forms.svg
:target: https://pypi.python.org/pypi/djangocms-aldryn-forms
:alt: status
.. |Python versions| image:: https://img.shields.io/pypi/pyversions/djangocms-aldryn-forms.svg
:target: https://pypi.python.org/pypi/djangocms-aldryn-forms
:alt: Python versions
.. |License| image:: https://img.shields.io/pypi/l/djangocms-aldryn-forms.svg
:target: https://github.com/CZ-NIC/djangocms-aldryn-forms/blob/master/LICENSE.txt
:alt: BSD License
Raw data
{
"_id": null,
"home_page": "https://github.com/CZ-NIC/djangocms-aldryn-forms",
"name": "djangocms-aldryn-forms",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Divio AG",
"author_email": "info@divio.ch",
"download_url": "https://files.pythonhosted.org/packages/2d/17/791bb3988590920a4c78571ea76b72a20ff187873481b08ac35da3054e49/djangocms_aldryn_forms-7.5.1.tar.gz",
"platform": null,
"description": "|Project continuation| |Pypi package| |Pypi status| |Python versions| |License|\n\n================\nAldryn Forms App\n================\n\nContinuation of the deprecated project `Divio Aldryn Forms <https://github.com/divio/aldryn-forms>`_.\n\nAldryn Forms allows you to build flexible HTML forms for your `Aldryn <http://aldryn.com>`_ and `django CMS\n<http://www.django-cms.org>`_ projects, and to integrate them directly in your pages.\n\nForms can be assembled using the form builder, with the familiar simple drag-and-drop interface of the django CMS\nplugin system.\n\nSubmitted data is stored in the Django database, and can be explored and exported using the admin, while forms can\nbe configured to send a confirmation message to users.\n\nContributing\n============\n\nThis is a an open-source project. We'll be delighted to receive your\nfeedback in the form of issues and pull requests. Before submitting your\npull request, please review our `contribution guidelines\n<http://docs.django-cms.org/en/latest/contributing/index.html>`_.\n\nWe're grateful to all contributors who have helped create and maintain this package.\nContributors are listed at the `contributors <https://github.com/divio/aldryn-forms/graphs/contributors>`_\nsection.\n\nInstallation\n============\n\nAldryn Platform Users\n---------------------\n\nChoose a site you want to install the add-on to from the dashboard. Then go to ``Apps -> Install app`` and click ``Install`` next to ``Forms`` app.\n\nRedeploy the site.\n\nUpgrading from < 2.0\n====================\nVersion 2.0 introduced a new model for form data storage called ``FormSubmission``.\nThe old ``FormData`` model has been deprecated.\nAlthough the ``FormData`` model's data is still accessible through the admin, all new form data will be stored in the new\n``FormSubmission`` model.\n\nManuall Installation\n--------------------\n\nRun ``pip install djangocms-aldryn-forms``.\n\nUpdate ``INSTALLED_APPS`` with ::\n\n INSTALLED_APPS = [\n ...\n 'aldryn_forms',\n 'aldryn_forms.contrib.email_notifications',\n 'captcha',\n ...\n ]\n\nAlso ensure you define an `e-mail backend <https://docs.djangoproject.com/en/dev/topics/email/#dummy-backend>`_ for your app.\n\n\nCreating a Form\n===============\n\nYou can create forms in the admin interface now. Search for the label ``Aldryn_Forms``.\n\nCreate a CMS page and install the ``Forms`` app there (choose ``Forms`` from the ``Advanced Settings -> Application`` dropdown).\n\nNow redeploy/restart the site again.\n\nThe above CMS site has become a forms POST landing page - a place where submission errors get displayed if there are any.\n\n\nAvailable Plug-ins\n==================\n\n- ``FormPlugin`` plugin lets you embed certain forms on a CMS page.\n- ``Fieldset`` groups fields.\n- ``TextField`` renders text input.\n- ``TextAreaField`` renders text input.\n- ``HiddenField``\n- ``PhoneField``\n- ``DateField``\n- ``DateTimeLocalField``\n- ``TimeField``\n- ``NumberField``\n- ``EmailField``\n- ``FileField`` renders a file upload input.\n- ``MultipleFilesField``\n- ``ImageField`` same as ``FileField`` but validates that the uploaded file is an image.\n- ``BooleanField`` renders checkbox.\n- ``SelectField`` renders single select input.\n- ``MultipleSelectField``\n- ``MultipleCheckboxSelectField`` renders multiple checkboxes.\n- ``CaptchaField``\n- ``HideContentWhenPostPlugin``\n\n\nMiddleware\n==========\n\nDispatch submitted form by middleware. If the HTTP header ``HTTP_X_REQUESTED_WITH`` is ``XMLHttpRequest`` a json response is returned.\n\nWrite in settings.py: ::\n\n MIDDLEWARE = [\n ...\n \"aldryn_forms.middleware.handle_post.HandleHttpPost\"\n ]\n\nSaving to the same post\n=======================\n\nActivation of repeated saving to the same post.\n\nWrite in settings.py: ::\n\n # Send email after 30 minutes. Remove post_ident after 30 minutes.\n ALDRYN_FORMS_MULTIPLE_SUBMISSION_DURATION = 30\n\n\nAfter this entry, the ``post_ident`` parameter is added to the success url for redirection. For example ::\n\n /thank-you/?post_ident=HErQ2TunSAU0AhTKrNSVDtSVBoYr9gTvUCUsdpMg6AZVqzExXCK06Tm7XIznf1sw\n\n\nSubmit form by javascript\n=========================\n\nActivating form submission via javascript ``fetch``: Add class ``submit-by-fetch`` into element ``form``.\n\nExample: ::\n\n <form class=\"submit-by-fetch\">\n ...\n </form>\n\n\nRun next submit\n===============\n\nUse the ``Form with Ident field`` plugin in the administration.\nIn the ``run_next`` dataset parameter, enter the name of the function to be executed after receiving the response\nfrom javascript ``fetch`` command.\n\nExample: ::\n\n <form data-run_next=\"runNext\">\n ...\n </form>\n\nExample of ``runNext`` javascript function: ::\n\n function runNext(form, data) {\n ...\n for (const input of document.querySelectorAll('input.aldryn-forms-field-ident')) {\n input.value = data.post_ident\n }\n ...\n }\n\n\nCommands\n========\n\nThe command ``aldryn_forms_remove_expired_post_idents`` deletes the ``post_ident`` values for all records older than the value in ``ALDRYN_FORMS_MULTIPLE_SUBMISSION_DURATION``.\n\nThe command ``aldryn_forms_send_emails`` will send all emails that are waiting to be sent.\n\nAdd these commands to crontab: ::\n\n\n 1/10 * * * * django-admin aldryn_forms_remove_expired_post_idents\n 1/10 * * * * django-admin aldryn_forms_send_emails\n\n\n\n.. |Project continuation| image:: https://img.shields.io/badge/Continuation-Divio_Aldryn_Froms-blue\n :target: https://github.com/CZ-NIC/djangocms-aldryn-forms\n :alt: Continuation of the deprecated project \"Divio Aldryn forms\"\n.. |Pypi package| image:: https://img.shields.io/pypi/v/djangocms-aldryn-forms.svg\n :target: https://pypi.python.org/pypi/djangocms-aldryn-forms/\n :alt: Pypi package\n.. |Pypi status| image:: https://img.shields.io/pypi/status/djangocms-aldryn-forms.svg\n :target: https://pypi.python.org/pypi/djangocms-aldryn-forms\n :alt: status\n.. |Python versions| image:: https://img.shields.io/pypi/pyversions/djangocms-aldryn-forms.svg\n :target: https://pypi.python.org/pypi/djangocms-aldryn-forms\n :alt: Python versions\n.. |License| image:: https://img.shields.io/pypi/l/djangocms-aldryn-forms.svg\n :target: https://github.com/CZ-NIC/djangocms-aldryn-forms/blob/master/LICENSE.txt\n :alt: BSD License\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Create forms and embed them on CMS pages.",
"version": "7.5.1",
"project_urls": {
"Homepage": "https://github.com/CZ-NIC/djangocms-aldryn-forms"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2344794b6f3814cfe24fd46d25b72f5f0e11fc10700e43ab9cad99b8a151f3cf",
"md5": "dadb57a574d04152241c8c94042aef4b",
"sha256": "389bfa6c666d6246ef5a466251645bc7d4cc01bef81763db1f1cc102ba6ae6de"
},
"downloads": -1,
"filename": "djangocms_aldryn_forms-7.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dadb57a574d04152241c8c94042aef4b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 161088,
"upload_time": "2025-02-20T02:18:54",
"upload_time_iso_8601": "2025-02-20T02:18:54.017591Z",
"url": "https://files.pythonhosted.org/packages/23/44/794b6f3814cfe24fd46d25b72f5f0e11fc10700e43ab9cad99b8a151f3cf/djangocms_aldryn_forms-7.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2d17791bb3988590920a4c78571ea76b72a20ff187873481b08ac35da3054e49",
"md5": "6baca7860f96c4fb63ced3b5be4b501e",
"sha256": "e041af5368ec6794c214dbabdc5a182844a756c3b56c9f1c971ff12d9728fb4a"
},
"downloads": -1,
"filename": "djangocms_aldryn_forms-7.5.1.tar.gz",
"has_sig": false,
"md5_digest": "6baca7860f96c4fb63ced3b5be4b501e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 105332,
"upload_time": "2025-02-20T02:18:55",
"upload_time_iso_8601": "2025-02-20T02:18:55.879934Z",
"url": "https://files.pythonhosted.org/packages/2d/17/791bb3988590920a4c78571ea76b72a20ff187873481b08ac35da3054e49/djangocms_aldryn_forms-7.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-20 02:18:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CZ-NIC",
"github_project": "djangocms-aldryn-forms",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"tox": true,
"lcname": "djangocms-aldryn-forms"
}