kopia lustrzana https://github.com/wagtail/wagtail
Rename wagtail.wagtailadmin to wagtail.admin
Conflicts: docs/advanced_topics/customisation/admin_templates.rst docs/advanced_topics/customisation/page_editing_interface.rst docs/advanced_topics/i18n/duplicate_tree.rst docs/advanced_topics/jinja2.rst docs/advanced_topics/settings.rst docs/getting_started/integrating_into_django.rst docs/getting_started/tutorial.rst docs/reference/hooks.rst docs/reference/pages/panels.rst docs/topics/pages.rst docs/topics/streamfield.rst wagtail/admin/blocks.py wagtail/admin/checks.py wagtail/admin/edit_handlers.py wagtail/admin/forms.py wagtail/admin/rich_text.py wagtail/admin/search.py wagtail/admin/site_summary.py wagtail/admin/templatetags/wagtailadmin_tags.py wagtail/admin/tests/test_admin_search.py wagtail/admin/tests/test_buttons_hooks.py wagtail/admin/tests/test_compare.py wagtail/admin/tests/test_edit_handlers.py wagtail/admin/tests/test_page_chooser.py wagtail/admin/tests/test_pages_views.py wagtail/admin/tests/test_rich_text.py wagtail/admin/tests/test_widgets.py wagtail/admin/tests/tests.py wagtail/admin/urls/__init__.py wagtail/admin/views/account.py wagtail/admin/views/chooser.py wagtail/admin/views/collection_privacy.py wagtail/admin/views/collections.py wagtail/admin/views/home.py wagtail/admin/views/page_privacy.py wagtail/admin/viewsets/model.py wagtail/admin/wagtail_hooks.py wagtail/admin/widgets.py wagtail/contrib/settings/registry.py wagtail/contrib/wagtailsearchpromotions/wagtail_hooks.py wagtail/contrib/wagtailstyleguide/wagtail_hooks.py wagtail/project_template/project_name/settings/base.py wagtail/project_template/project_name/urls.py wagtail/tests/non_root_urls.py wagtail/tests/settings.py wagtail/tests/snippets/models.py wagtail/tests/testapp/models.py wagtail/tests/testapp/wagtail_hooks.py wagtail/tests/urls.py wagtail/wagtaildocs/models.py wagtail/wagtaildocs/views/chooser.py wagtail/wagtaildocs/wagtail_hooks.py wagtail/wagtailembeds/wagtail_hooks.py wagtail/wagtailforms/models.py wagtail/wagtailforms/tests/test_views.py wagtail/wagtailforms/views.py wagtail/wagtailforms/wagtail_hooks.py wagtail/wagtailimages/models.py wagtail/wagtailimages/views/chooser.py wagtail/wagtailimages/wagtail_hooks.py wagtail/wagtailredirects/forms.py wagtail/wagtailredirects/wagtail_hooks.py wagtail/wagtailsites/forms.py wagtail/wagtailsites/views.py wagtail/wagtailsites/wagtail_hooks.py wagtail/wagtailsnippets/tests.py wagtail/wagtailsnippets/wagtail_hooks.py wagtail/wagtailusers/forms.py wagtail/wagtailusers/views/groups.py wagtail/wagtailusers/wagtail_hooks.pypull/4068/head
rodzic
11b822d2dc
commit
062d05189b
|
@ -2,8 +2,8 @@
|
|||
host = https://www.transifex.com
|
||||
|
||||
[wagtail.wagtailadmin]
|
||||
file_filter = wagtail/wagtailadmin/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = wagtail/wagtailadmin/locale/en/LC_MESSAGES/django.po
|
||||
file_filter = wagtail/admin/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = wagtail/admin/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Customising admin templates
|
|||
|
||||
In your projects with Wagtail, you may wish to replace elements such as the Wagtail logo within the admin interface with your own branding. This can be done through Django's template inheritance mechanism.
|
||||
|
||||
You need to create a ``templates/wagtailadmin/`` folder within one of your apps - this may be an existing one, or a new one created for this purpose, for example, ``dashboard``. This app must be registered in ``INSTALLED_APPS`` before ``wagtail.wagtailadmin``:
|
||||
You need to create a ``templates/wagtailadmin/`` folder within one of your apps - this may be an existing one, or a new one created for this purpose, for example, ``dashboard``. This app must be registered in ``INSTALLED_APPS`` before ``wagtail.admin``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@ -14,7 +14,7 @@ You need to create a ``templates/wagtailadmin/`` folder within one of your apps
|
|||
'dashboard',
|
||||
|
||||
'wagtail.core',
|
||||
'wagtail.wagtailadmin',
|
||||
'wagtail.admin',
|
||||
|
||||
# ...
|
||||
)
|
||||
|
|
|
@ -10,7 +10,7 @@ As standard, Wagtail organises panels for pages into three tabs: 'Content', 'Pro
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin.edit_handlers import TabbedInterface, ObjectList
|
||||
from wagtail.admin.edit_handlers import TabbedInterface, ObjectList
|
||||
|
||||
class BlogPage(Page):
|
||||
# field definitions omitted
|
||||
|
@ -43,7 +43,7 @@ Wagtail provides a general-purpose WYSIWYG editor for creating rich text content
|
|||
.. code-block:: python
|
||||
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
|
||||
|
||||
class BookPage(Page):
|
||||
|
@ -96,7 +96,7 @@ Once the plugin has been created, it should be registered as a rich text feature
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin.rich_text import HalloPlugin
|
||||
from wagtail.admin.rich_text import HalloPlugin
|
||||
from wagtail.core import hooks
|
||||
|
||||
@hooks.register('register_rich_text_features')
|
||||
|
@ -178,15 +178,15 @@ To unregister, call ``unregister_image_format`` with the string of the ``name``
|
|||
Customising generated forms
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. class:: wagtail.wagtailadmin.forms.WagtailAdminModelForm
|
||||
.. class:: wagtail.wagtailadmin.forms.WagtailAdminPageForm
|
||||
.. class:: wagtail.admin.forms.WagtailAdminModelForm
|
||||
.. class:: wagtail.admin.forms.WagtailAdminPageForm
|
||||
|
||||
Wagtail automatically generates forms using the panels configured on the model.
|
||||
By default, this form subclasses :class:`~wagtail.wagtailadmin.forms.WagtailAdminModelForm`,
|
||||
or :class:`~wagtail.wagtailadmin.forms.WagtailAdminPageForm` for pages.
|
||||
By default, this form subclasses :class:`~wagtail.admin.forms.WagtailAdminModelForm`,
|
||||
or :class:`~wagtail.admin.forms.WagtailAdminPageForm` for pages.
|
||||
A custom base form class can be configured by setting the :attr:`base_form_class` attribute on any model.
|
||||
Custom forms for snippets must subclass :class:`~wagtail.wagtailadmin.forms.WagtailAdminModelForm`,
|
||||
and custom forms for pages must subclass :class:`~wagtail.wagtailadmin.forms.WagtailAdminPageForm`.
|
||||
Custom forms for snippets must subclass :class:`~wagtail.admin.forms.WagtailAdminModelForm`,
|
||||
and custom forms for pages must subclass :class:`~wagtail.admin.forms.WagtailAdminPageForm`.
|
||||
|
||||
This can be used to add non-model fields to the form, to automatically generate field content,
|
||||
or to add custom validation logic for your models:
|
||||
|
@ -195,8 +195,8 @@ or to add custom validation logic for your models:
|
|||
|
||||
from django import forms
|
||||
import geocoder # not in Wagtail, for example only - http://geocoder.readthedocs.io/
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from wagtail.admin.forms import WagtailAdminPageForm
|
||||
from wagtail.core.models import Page
|
||||
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ Here's an example of how this could be implemented (with English as the main lan
|
|||
.. code-block:: python
|
||||
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.wagtailadmin.edit_handlers import MultiFieldPanel, PageChooserPanel
|
||||
from wagtail.admin.edit_handlers import MultiFieldPanel, PageChooserPanel
|
||||
|
||||
|
||||
class TranslatablePageMixin(models.Model):
|
||||
|
|
|
@ -87,7 +87,7 @@ This feature is enabled through the project's root URL configuration. Just put t
|
|||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.admin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.core import urls as wagtail_urls
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Django needs to be configured to support Jinja2 templates. As the Wagtail admin
|
|||
'OPTIONS': {
|
||||
'extensions': [
|
||||
'wagtail.core.jinja2tags.core',
|
||||
'wagtail.wagtailadmin.jinja2tags.userbar',
|
||||
'wagtail.admin.jinja2tags.userbar',
|
||||
'wagtail.wagtailimages.jinja2tags.images',
|
||||
],
|
||||
},
|
||||
|
|
|
@ -69,7 +69,7 @@ Apps (``settings.py``)
|
|||
'wagtail.wagtaildocs',
|
||||
'wagtail.wagtailimages',
|
||||
'wagtail.wagtailsearch',
|
||||
'wagtail.wagtailadmin',
|
||||
'wagtail.admin',
|
||||
'wagtail.core',
|
||||
|
||||
'taggit',
|
||||
|
@ -448,7 +448,7 @@ URL Patterns
|
|||
from django.contrib import admin
|
||||
|
||||
from wagtail.core import urls as wagtail_urls
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.admin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.wagtailsearch import urls as wagtailsearch_urls
|
||||
|
||||
|
@ -511,7 +511,7 @@ These two files should reside in your project directory (``myproject/myproject/`
|
|||
'wagtail.wagtaildocs',
|
||||
'wagtail.wagtailimages',
|
||||
'wagtail.wagtailsearch',
|
||||
'wagtail.wagtailadmin',
|
||||
'wagtail.admin',
|
||||
'wagtail.core',
|
||||
|
||||
'taggit',
|
||||
|
@ -691,7 +691,7 @@ These two files should reside in your project directory (``myproject/myproject/`
|
|||
import os.path
|
||||
|
||||
from wagtail.core import urls as wagtail_urls
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.admin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.wagtailsearch import urls as wagtailsearch_urls
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ In your settings file, add the following apps to ``INSTALLED_APPS``:
|
|||
'wagtail.wagtaildocs',
|
||||
'wagtail.wagtailimages',
|
||||
'wagtail.wagtailsearch',
|
||||
'wagtail.wagtailadmin',
|
||||
'wagtail.admin',
|
||||
'wagtail.core',
|
||||
|
||||
'modelcluster',
|
||||
|
@ -63,7 +63,7 @@ Now make the following additions to your ``urls.py`` file:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin import urls as wagtailadmin_urls
|
||||
from wagtail.admin import urls as wagtailadmin_urls
|
||||
from wagtail.wagtaildocs import urls as wagtaildocs_urls
|
||||
from wagtail.core import urls as wagtail_urls
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ Edit ``home/models.py`` as follows, to add a ``body`` field to the model:
|
|||
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
|
||||
|
||||
class HomePage(Page):
|
||||
|
@ -166,7 +166,7 @@ Lets start with a simple index page for our blog. In ``blog/models.py``:
|
|||
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
|
||||
|
||||
class BlogIndexPage(Page):
|
||||
|
@ -220,7 +220,7 @@ Now we need a model and template for our blog posts. In ``blog/models.py``:
|
|||
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
|
||||
|
@ -411,7 +411,7 @@ Add a new ``BlogPageGalleryImage`` model to ``models.py``:
|
|||
|
||||
from wagtail.core.models import Page, Orderable
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
|
@ -574,7 +574,7 @@ First, alter ``models.py`` once more:
|
|||
|
||||
from wagtail.core.models import Page, Orderable
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, MultiFieldPanel
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ You can do this as shown below.
|
|||
.. code-block:: python
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
@ -65,7 +65,7 @@ Example:
|
|||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db import models
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
@ -126,7 +126,7 @@ The following example shows how to add a username to the CSV export:
|
|||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
from django.db import models
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
@ -204,7 +204,7 @@ Example:
|
|||
from django.db import models
|
||||
from django.shortcuts import render
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
@ -300,7 +300,7 @@ The following example shows how to create a multi-step form.
|
|||
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
|
||||
from django.shortcuts import render
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
@ -451,7 +451,7 @@ First, you need to collect results as shown below:
|
|||
.. code-block:: python
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
|
|
@ -29,7 +29,7 @@ Within the ``models.py`` of one of your apps, create a model that extends ``wagt
|
|||
.. code-block:: python
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
from wagtail.wagtailadmin.edit_handlers import (
|
||||
from wagtail.admin.edit_handlers import (
|
||||
FieldPanel, FieldRowPanel,
|
||||
InlinePanel, MultiFieldPanel
|
||||
)
|
||||
|
|
|
@ -64,7 +64,7 @@ with a custom ``edit_handler`` attribute:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin.edit_handlers import TabbedInterface, ObjectList
|
||||
from wagtail.admin.edit_handlers import TabbedInterface, ObjectList
|
||||
|
||||
@register_setting
|
||||
class MySettings(BaseSetting):
|
||||
|
|
|
@ -126,7 +126,7 @@ Hooks for building new areas of the admin interface (alongside pages, images, do
|
|||
``register_admin_menu_item``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Add an item to the Wagtail admin menu. The callable passed to this hook must return an instance of ``wagtail.wagtailadmin.menu.MenuItem``. New items can be constructed from the ``MenuItem`` class by passing in a ``label`` which will be the text in the menu item, and the URL of the admin page you want the menu item to link to (usually by calling ``reverse()`` on the admin view you've set up). Additionally, the following keyword arguments are accepted:
|
||||
Add an item to the Wagtail admin menu. The callable passed to this hook must return an instance of ``wagtail.admin.menu.MenuItem``. New items can be constructed from the ``MenuItem`` class by passing in a ``label`` which will be the text in the menu item, and the URL of the admin page you want the menu item to link to (usually by calling ``reverse()`` on the admin view you've set up). Additionally, the following keyword arguments are accepted:
|
||||
|
||||
:name: an internal name used to identify the menu item; defaults to the slugified form of the label.
|
||||
:classnames: additional classnames applied to the link, used to give it an icon
|
||||
|
@ -140,7 +140,7 @@ Hooks for building new areas of the admin interface (alongside pages, images, do
|
|||
from django.urls import reverse
|
||||
|
||||
from wagtail.core import hooks
|
||||
from wagtail.wagtailadmin.menu import MenuItem
|
||||
from wagtail.admin.menu import MenuItem
|
||||
|
||||
@hooks.register('register_admin_menu_item')
|
||||
def register_frank_menu_item():
|
||||
|
@ -196,7 +196,7 @@ Hooks for building new areas of the admin interface (alongside pages, images, do
|
|||
``register_admin_search_area``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Add an item to the Wagtail admin search "Other Searches". Behaviour of this hook is similar to ``register_admin_menu_item``. The callable passed to this hook must return an instance of ``wagtail.wagtailadmin.search.SearchArea``. New items can be constructed from the ``SearchArea`` class by passing the following parameters:
|
||||
Add an item to the Wagtail admin search "Other Searches". Behaviour of this hook is similar to ``register_admin_menu_item``. The callable passed to this hook must return an instance of ``wagtail.admin.search.SearchArea``. New items can be constructed from the ``SearchArea`` class by passing the following parameters:
|
||||
|
||||
:label: text displayed in the "Other Searches" option box.
|
||||
:name: an internal name used to identify the search option; defaults to the slugified form of the label.
|
||||
|
@ -216,7 +216,7 @@ Hooks for building new areas of the admin interface (alongside pages, images, do
|
|||
|
||||
from django.urls import reverse
|
||||
from wagtail.core import hooks
|
||||
from wagtail.wagtailadmin.search import SearchArea
|
||||
from wagtail.admin.search import SearchArea
|
||||
|
||||
@hooks.register('register_admin_search_area')
|
||||
def register_frank_search_area():
|
||||
|
@ -691,7 +691,7 @@ Page explorer
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin import widgets as wagtailadmin_widgets
|
||||
from wagtail.admin import widgets as wagtailadmin_widgets
|
||||
|
||||
@hooks.register('register_page_listing_buttons')
|
||||
def page_listing_buttons(page, page_perms, is_parent=False):
|
||||
|
@ -715,7 +715,7 @@ Page explorer
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailadmin import widgets as wagtailadmin_widgets
|
||||
from wagtail.admin import widgets as wagtailadmin_widgets
|
||||
|
||||
@hooks.register('register_page_listing_more_buttons')
|
||||
def page_listing_more_buttons(page, page_perms, is_parent=False):
|
||||
|
|
|
@ -210,7 +210,7 @@ In addition to the model fields provided, ``Page`` has many properties and metho
|
|||
|
||||
The form class used as a base for editing Pages of this type in the Wagtail page editor.
|
||||
This attribute can be set on a model to customise the Page editor form.
|
||||
Forms must be a subclass of :class:`~wagtail.wagtailadmin.forms.WagtailAdminPageForm`.
|
||||
Forms must be a subclass of :class:`~wagtail.admin.forms.WagtailAdminPageForm`.
|
||||
See :ref:`custom_edit_handler_forms` for more information.
|
||||
|
||||
.. _site-model-ref:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Available panel types
|
||||
=====================
|
||||
|
||||
.. module:: wagtail.wagtailadmin.edit_handlers
|
||||
.. module:: wagtail.admin.edit_handlers
|
||||
|
||||
FieldPanel
|
||||
----------
|
||||
|
@ -35,7 +35,7 @@ MultiFieldPanel
|
|||
|
||||
.. class:: MultiFieldPanel(children, heading="", classname=None)
|
||||
|
||||
This panel condenses several :class:`~wagtail.wagtailadmin.edit_handlers.FieldPanel` s or choosers, from a ``list`` or ``tuple``, under a single ``heading`` string.
|
||||
This panel condenses several :class:`~wagtail.admin.edit_handlers.FieldPanel` s or choosers, from a ``list`` or ``tuple``, under a single ``heading`` string.
|
||||
|
||||
.. attribute:: MultiFieldPanel.children
|
||||
|
||||
|
@ -101,7 +101,7 @@ PageChooserPanel
|
|||
.. code-block:: python
|
||||
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.wagtailadmin.edit_handlers import PageChooserPanel
|
||||
from wagtail.admin.edit_handlers import PageChooserPanel
|
||||
|
||||
|
||||
class BookPage(Page):
|
||||
|
@ -246,7 +246,7 @@ SnippetChooserPanel
|
|||
Built-in Fields and Choosers
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Django's field types are automatically recognised and provided with an appropriate widget for input. Just define that field the normal Django way and pass the field name into :class:`~wagtail.wagtailadmin.edit_handlers.FieldPanel` when defining your panels. Wagtail will take care of the rest.
|
||||
Django's field types are automatically recognised and provided with an appropriate widget for input. Just define that field the normal Django way and pass the field name into :class:`~wagtail.admin.edit_handlers.FieldPanel` when defining your panels. Wagtail will take care of the rest.
|
||||
|
||||
Here are some Wagtail-specific types that you might include as fields in your models.
|
||||
|
||||
|
@ -262,7 +262,7 @@ By adding CSS classes to your panel definitions or adding extra parameters to yo
|
|||
Full-Width Input
|
||||
----------------
|
||||
|
||||
Use ``classname="full"`` to make a field (input element) stretch the full width of the Wagtail page editor. This will not work if the field is encapsulated in a :class:`~wagtail.wagtailadmin.edit_handlers.MultiFieldPanel`, which places its child fields into a formset.
|
||||
Use ``classname="full"`` to make a field (input element) stretch the full width of the Wagtail page editor. This will not work if the field is encapsulated in a :class:`~wagtail.admin.edit_handlers.MultiFieldPanel`, which places its child fields into a formset.
|
||||
|
||||
|
||||
Titles
|
||||
|
@ -327,7 +327,7 @@ Let's look at the example of adding related links to a :class:`~wagtail.core.mod
|
|||
InlinePanel('related_links', label="Related Links"),
|
||||
]
|
||||
|
||||
The ``RelatedLink`` class is a vanilla Django abstract model. The ``BookPageRelatedLinks`` model extends it with capability for being ordered in the Wagtail interface via the ``Orderable`` class as well as adding a ``page`` property which links the model to the ``BookPage`` model we're adding the related links objects to. Finally, in the panel definitions for ``BookPage``, we'll add an :class:`~wagtail.wagtailadmin.edit_handlers.InlinePanel` to provide an interface for it all. Let's look again at the parameters that :class:`~wagtail.wagtailadmin.edit_handlers.InlinePanel` accepts:
|
||||
The ``RelatedLink`` class is a vanilla Django abstract model. The ``BookPageRelatedLinks`` model extends it with capability for being ordered in the Wagtail interface via the ``Orderable`` class as well as adding a ``page`` property which links the model to the ``BookPage`` model we're adding the related links objects to. Finally, in the panel definitions for ``BookPage``, we'll add an :class:`~wagtail.admin.edit_handlers.InlinePanel` to provide an interface for it all. Let's look again at the parameters that :class:`~wagtail.admin.edit_handlers.InlinePanel` accepts:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@ -337,7 +337,7 @@ The ``relation_name`` is the ``related_name`` label given to the cluster's ``Par
|
|||
|
||||
.. versionchanged:: 1.0
|
||||
|
||||
In previous versions, it was necessary to pass the base model as the first parameter to :class:`~wagtail.wagtailadmin.edit_handlers.InlinePanel`; this is no longer required.
|
||||
In previous versions, it was necessary to pass the base model as the first parameter to :class:`~wagtail.admin.edit_handlers.InlinePanel`; this is no longer required.
|
||||
|
||||
For another example of using model clusters, see :ref:`tagging`
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ This example represents a typical blog post:
|
|||
|
||||
from wagtail.core.models import Page, Orderable
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, MultiFieldPanel, InlinePanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel, MultiFieldPanel, InlinePanel
|
||||
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
|
||||
from wagtail.wagtailsearch import index
|
||||
|
||||
|
@ -143,22 +143,22 @@ Here's a summary of the ``EditHandler`` classes that Wagtail provides out of the
|
|||
|
||||
These allow editing of model fields. The ``FieldPanel`` class will choose the correct widget based on the type of the field, though ``StreamField`` fields need to use a specialised panel class.
|
||||
|
||||
- :class:`~wagtail.wagtailadmin.edit_handlers.FieldPanel`
|
||||
- :class:`~wagtail.wagtailadmin.edit_handlers.StreamFieldPanel`
|
||||
- :class:`~wagtail.admin.edit_handlers.FieldPanel`
|
||||
- :class:`~wagtail.admin.edit_handlers.StreamFieldPanel`
|
||||
|
||||
**Structural**
|
||||
|
||||
These are used for structuring fields in the interface.
|
||||
|
||||
- :class:`~wagtail.wagtailadmin.edit_handlers.MultiFieldPanel` - For grouping similar fields together
|
||||
- :class:`~wagtail.wagtailadmin.edit_handlers.InlinePanel` - For inlining child models
|
||||
- :class:`~wagtail.wagtailadmin.edit_handlers.FieldRowPanel` - For organising multiple fields into a single row
|
||||
- :class:`~wagtail.admin.edit_handlers.MultiFieldPanel` - For grouping similar fields together
|
||||
- :class:`~wagtail.admin.edit_handlers.InlinePanel` - For inlining child models
|
||||
- :class:`~wagtail.admin.edit_handlers.FieldRowPanel` - For organising multiple fields into a single row
|
||||
|
||||
**Chooser**
|
||||
|
||||
``ForeignKey`` fields to certain models can use one of the below ``ChooserPanel`` classes. These add a nice modal chooser interface, and the image/document choosers also allow uploading new files without leaving the page editor.
|
||||
|
||||
- :class:`~wagtail.wagtailadmin.edit_handlers.PageChooserPanel`
|
||||
- :class:`~wagtail.admin.edit_handlers.PageChooserPanel`
|
||||
- :class:`~wagtail.wagtailimages.edit_handlers.ImageChooserPanel`
|
||||
- :class:`~wagtail.wagtaildocs.edit_handlers.DocumentChooserPanel`
|
||||
- :class:`~wagtail.wagtailsnippets.edit_handlers.SnippetChooserPanel`
|
||||
|
@ -393,7 +393,7 @@ For example, the following inline model can be used to add related links (a list
|
|||
FieldPanel('url'),
|
||||
]
|
||||
|
||||
To add this to the admin interface, use the :class:`~wagtail.wagtailadmin.edit_handlers.InlinePanel` edit panel class:
|
||||
To add this to the admin interface, use the :class:`~wagtail.admin.edit_handlers.InlinePanel` edit panel class:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Here's an example snippet model:
|
|||
|
||||
from django.db import models
|
||||
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from wagtail.wagtailsnippets.models import register_snippet
|
||||
|
||||
...
|
||||
|
|
|
@ -22,7 +22,7 @@ Using StreamField
|
|||
from wagtail.core.models import Page
|
||||
from wagtail.core.fields import StreamField
|
||||
from wagtail.core import blocks
|
||||
from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel
|
||||
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
|
||||
from wagtail.wagtailimages.blocks import ImageChooserBlock
|
||||
|
||||
class BlogPage(Page):
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
default_app_config = 'wagtail.admin.apps.WagtailAdminAppConfig'
|
|
@ -6,6 +6,6 @@ from . import checks # NOQA
|
|||
|
||||
|
||||
class WagtailAdminAppConfig(AppConfig):
|
||||
name = 'wagtail.wagtailadmin'
|
||||
name = 'wagtail.admin'
|
||||
label = 'wagtailadmin'
|
||||
verbose_name = "Wagtail admin"
|
|
@ -4,4 +4,4 @@ import warnings
|
|||
|
||||
from wagtail.core.blocks import * # noqa
|
||||
|
||||
warnings.warn("wagtail.wagtailadmin.blocks has moved to wagtail.core.blocks", UserWarning, stacklevel=2)
|
||||
warnings.warn("wagtail.admin.blocks has moved to wagtail.core.blocks", UserWarning, stacklevel=2)
|
|
@ -34,7 +34,7 @@ def css_install_check(app_configs, **kwargs):
|
|||
|
||||
@register()
|
||||
def base_form_class_check(app_configs, **kwargs):
|
||||
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
|
||||
from wagtail.admin.forms import WagtailAdminPageForm
|
||||
from wagtail.core.models import get_page_models
|
||||
|
||||
errors = []
|
||||
|
@ -55,7 +55,7 @@ def base_form_class_check(app_configs, **kwargs):
|
|||
|
||||
@register()
|
||||
def get_form_class_check(app_configs, **kwargs):
|
||||
from wagtail.wagtailadmin.forms import WagtailAdminPageForm
|
||||
from wagtail.admin.forms import WagtailAdminPageForm
|
||||
from wagtail.core.models import get_page_models
|
||||
|
||||
errors = []
|
|
@ -6,7 +6,7 @@ from django.urls import reverse
|
|||
from django.utils.translation import activate as activate_lang
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from wagtail.wagtailadmin import messages
|
||||
from wagtail.admin import messages
|
||||
|
||||
|
||||
def reject_request(request):
|
|
@ -14,7 +14,7 @@ from django.utils.translation import ugettext_lazy
|
|||
from taggit.managers import TaggableManager
|
||||
|
||||
from wagtail.utils.decorators import cached_classmethod
|
||||
from wagtail.wagtailadmin import compare, widgets
|
||||
from wagtail.admin import compare, widgets
|
||||
from wagtail.core.fields import RichTextField
|
||||
from wagtail.core.models import Page
|
||||
from wagtail.core.utils import camelcase_to_underscore, resolve_model_string
|
|
@ -18,7 +18,7 @@ from django.utils.translation import ugettext_lazy, ungettext
|
|||
from modelcluster.forms import ClusterForm, ClusterFormMetaclass
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
from wagtail.wagtailadmin import widgets
|
||||
from wagtail.admin import widgets
|
||||
from wagtail.core.models import (
|
||||
BaseViewRestriction, Collection, CollectionViewRestriction, GroupCollectionPermission, Page,
|
||||
PageViewRestriction)
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue