kopia lustrzana https://github.com/wagtail/wagtail
Renamed wagtail.wagtailforms to wagtail.contrib.forms
Conflicts: docs/reference/contrib/forms/customisation.rst docs/reference/contrib/forms/index.rst wagtail/contrib/forms/tests/test_forms.py wagtail/contrib/forms/tests/test_models.py wagtail/contrib/forms/tests/test_views.py wagtail/contrib/forms/views.py wagtail/contrib/forms/wagtail_hooks.py wagtail/tests/settings.py wagtail/tests/testapp/models.pypull/4068/head
rodzic
80ff06f988
commit
f29ce6c1f9
|
@ -56,8 +56,8 @@ source_lang = en
|
|||
type = PO
|
||||
|
||||
[wagtail.wagtailforms]
|
||||
file_filter = wagtail/wagtailforms/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = wagtail/wagtailforms/locale/en/LC_MESSAGES/django.po
|
||||
file_filter = wagtail/contrib/forms/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ Apps (``settings.py``)
|
|||
|
||||
'myapp', # your own app
|
||||
|
||||
'wagtail.wagtailforms',
|
||||
'wagtail.contrib.forms',
|
||||
'wagtail.wagtailredirects',
|
||||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
|
@ -502,7 +502,7 @@ These two files should reside in your project directory (``myproject/myproject/`
|
|||
INSTALLED_APPS = [
|
||||
'myapp',
|
||||
|
||||
'wagtail.wagtailforms',
|
||||
'wagtail.contrib.forms',
|
||||
'wagtail.wagtailredirects',
|
||||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
|
|
|
@ -20,7 +20,7 @@ In your settings file, add the following apps to ``INSTALLED_APPS``:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
'wagtail.wagtailforms',
|
||||
'wagtail.contrib.forms',
|
||||
'wagtail.wagtailredirects',
|
||||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
|
|
|
@ -19,7 +19,7 @@ You can do this as shown below.
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
@ -52,7 +52,7 @@ Custom form submission model
|
|||
If you need to save additional data, you can use a custom form submission model.
|
||||
To do this, you need to:
|
||||
|
||||
* Define a model that extends ``wagtail.wagtailforms.models.AbstractFormSubmission``.
|
||||
* Define a model that extends ``wagtail.contrib.forms.models.AbstractFormSubmission``.
|
||||
* Override the ``get_submission_class`` and ``process_form_submission`` methods in your page model.
|
||||
|
||||
Example:
|
||||
|
@ -70,7 +70,7 @@ Example:
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField, AbstractFormSubmission
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField, AbstractFormSubmission
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
@ -131,7 +131,7 @@ The following example shows how to add a username to the CSV export:
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField, AbstractFormSubmission
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField, AbstractFormSubmission
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
@ -209,7 +209,7 @@ Example:
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField, AbstractFormSubmission
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField, AbstractFormSubmission
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
@ -305,7 +305,7 @@ The following example shows how to create a multi-step form.
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
@ -456,7 +456,7 @@ First, you need to collect results as shown below:
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
|
|
@ -14,13 +14,13 @@ The ``wagtailforms`` module allows you to set up single-page forms, such as a 'C
|
|||
Usage
|
||||
~~~~~
|
||||
|
||||
Add ``wagtail.wagtailforms`` to your ``INSTALLED_APPS``:
|
||||
Add ``wagtail.contrib.forms`` to your ``INSTALLED_APPS``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
INSTALLED_APPS = [
|
||||
...
|
||||
'wagtail.wagtailforms',
|
||||
'wagtail.contrib.forms',
|
||||
]
|
||||
|
||||
Within the ``models.py`` of one of your apps, create a model that extends ``wagtailforms.models.AbstractEmailForm``:
|
||||
|
@ -34,7 +34,7 @@ Within the ``models.py`` of one of your apps, create a model that extends ``wagt
|
|||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailforms.models import AbstractEmailForm, AbstractFormField
|
||||
from wagtail.contrib.forms.models import AbstractEmailForm, AbstractFormField
|
||||
|
||||
|
||||
class FormField(AbstractFormField):
|
||||
|
@ -94,7 +94,7 @@ Displaying form submission information
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailforms.edit_handlers import FormSubmissionsPanel
|
||||
from wagtail.contrib.forms.edit_handlers import FormSubmissionsPanel
|
||||
|
||||
class FormPage(AbstractEmailForm):
|
||||
# ...
|
||||
|
|
|
@ -163,17 +163,17 @@ ImageChooserPanel
|
|||
FormSubmissionsPanel
|
||||
--------------------
|
||||
|
||||
.. module:: wagtail.wagtailforms.edit_handlers
|
||||
.. module:: wagtail.contrib.forms.edit_handlers
|
||||
|
||||
.. class:: FormSubmissionsPanel
|
||||
|
||||
This panel adds a single, read-only section in the edit interface for pages implementing the :class:`~wagtail.wagtailforms.models.AbstractForm` model.
|
||||
This panel adds a single, read-only section in the edit interface for pages implementing the :class:`~wagtail.contrib.forms.models.AbstractForm` model.
|
||||
It includes the number of total submissions for the given form and also a link to the listing of submissions.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailforms.models import AbstractForm
|
||||
from wagtail.wagtailforms.edit_handlers import FormSubmissionsPanel
|
||||
from wagtail.contrib.forms.models import AbstractForm
|
||||
from wagtail.contrib.forms.edit_handlers import FormSubmissionsPanel
|
||||
|
||||
class ContactFormPage(AbstractForm):
|
||||
content_panels = [
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
default_app_config = 'wagtail.contrib.forms.apps.WagtailFormsAppConfig'
|
|
@ -4,6 +4,6 @@ from django.apps import AppConfig
|
|||
|
||||
|
||||
class WagtailFormsAppConfig(AppConfig):
|
||||
name = 'wagtail.wagtailforms'
|
||||
name = 'wagtail.contrib.forms'
|
||||
label = 'wagtailforms'
|
||||
verbose_name = "Wagtail forms"
|
|
@ -6,7 +6,7 @@ from django.test import TestCase
|
|||
|
||||
from wagtail.tests.testapp.models import FormField, FormPage
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.wagtailforms.forms import FormBuilder
|
||||
from wagtail.contrib.forms.forms import FormBuilder
|
||||
|
||||
|
||||
class TestFormBuilder(TestCase):
|
|
@ -9,8 +9,8 @@ from django.test import TestCase
|
|||
from wagtail.tests.testapp.models import CustomFormPageSubmission, FormField, JadeFormPage
|
||||
from wagtail.tests.utils import WagtailTestUtils
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.wagtailforms.models import FormSubmission
|
||||
from wagtail.wagtailforms.tests.utils import make_form_page, make_form_page_with_custom_submission
|
||||
from wagtail.contrib.forms.models import FormSubmission
|
||||
from wagtail.contrib.forms.tests.utils import make_form_page, make_form_page_with_custom_submission
|
||||
|
||||
|
||||
class TestFormSubmission(TestCase):
|
|
@ -13,9 +13,9 @@ from wagtail.tests.utils import WagtailTestUtils
|
|||
from wagtail.admin.edit_handlers import get_form_for_model
|
||||
from wagtail.admin.forms import WagtailAdminPageForm
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.wagtailforms.edit_handlers import FormSubmissionsPanel
|
||||
from wagtail.wagtailforms.models import FormSubmission
|
||||
from wagtail.wagtailforms.tests.utils import make_form_page, make_form_page_with_custom_submission
|
||||
from wagtail.contrib.forms.edit_handlers import FormSubmissionsPanel
|
||||
from wagtail.contrib.forms.models import FormSubmission
|
||||
from wagtail.contrib.forms.tests.utils import make_form_page, make_form_page_with_custom_submission
|
||||
|
||||
|
||||
class TestFormResponsesPanel(TestCase):
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue