kopia lustrzana https://github.com/wagtail/wagtail
Rename wagtail.wagtailsnippets to wagtail.snippets
Conflicts: docs/advanced_topics/settings.rst docs/getting_started/integrating_into_django.rst docs/topics/pages.rst docs/topics/snippets.rst gulpfile.js/config.js wagtail/contrib/wagtailstyleguide/views.py wagtail/project_template/project_name/settings/base.py wagtail/snippets/tests.py wagtail/snippets/views/chooser.py wagtail/snippets/views/snippets.py wagtail/snippets/wagtail_hooks.py wagtail/tests/settings.py wagtail/tests/snippets/models.py wagtail/tests/testapp/models.pypull/4068/head
rodzic
b08d4dd83a
commit
1ecf48fb3f
|
@ -44,8 +44,8 @@ source_lang = en
|
|||
type = PO
|
||||
|
||||
[wagtail.wagtailsnippets]
|
||||
file_filter = wagtail/wagtailsnippets/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = wagtail/wagtailsnippets/locale/en/LC_MESSAGES/django.po
|
||||
file_filter = wagtail/snippets/locale/<lang>/LC_MESSAGES/django.po
|
||||
source_file = wagtail/snippets/locale/en/LC_MESSAGES/django.po
|
||||
source_lang = en
|
||||
type = PO
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ Apps (``settings.py``)
|
|||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
'wagtail.wagtailusers',
|
||||
'wagtail.wagtailsnippets',
|
||||
'wagtail.snippets',
|
||||
'wagtail.documents',
|
||||
'wagtail.images',
|
||||
'wagtail.search',
|
||||
|
@ -507,7 +507,7 @@ These two files should reside in your project directory (``myproject/myproject/`
|
|||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
'wagtail.wagtailusers',
|
||||
'wagtail.wagtailsnippets',
|
||||
'wagtail.snippets',
|
||||
'wagtail.documents',
|
||||
'wagtail.images',
|
||||
'wagtail.search',
|
||||
|
|
|
@ -25,7 +25,7 @@ In your settings file, add the following apps to ``INSTALLED_APPS``:
|
|||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
'wagtail.wagtailusers',
|
||||
'wagtail.wagtailsnippets',
|
||||
'wagtail.snippets',
|
||||
'wagtail.documents',
|
||||
'wagtail.images',
|
||||
'wagtail.search',
|
||||
|
|
|
@ -720,7 +720,7 @@ First, we define a ``BlogCategory`` model. A category is not a page in its own r
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailsnippets.models import register_snippet
|
||||
from wagtail.snippets.models import register_snippet
|
||||
|
||||
|
||||
@register_snippet
|
||||
|
|
|
@ -217,7 +217,7 @@ SnippetChooserPanel
|
|||
|
||||
Before Wagtail 1.1, it was necessary to pass the snippet model class as a second parameter to ``SnippetChooserPanel``. This is now automatically picked up from the field.
|
||||
|
||||
.. module:: wagtail.wagtailsnippets.edit_handlers
|
||||
.. module:: wagtail.snippets.edit_handlers
|
||||
|
||||
.. class:: SnippetChooserPanel(field_name, snippet_type=None)
|
||||
|
||||
|
@ -225,7 +225,7 @@ SnippetChooserPanel
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
|
||||
from wagtail.snippets.edit_handlers import SnippetChooserPanel
|
||||
|
||||
class BookPage(Page):
|
||||
advert = models.ForeignKey(
|
||||
|
|
|
@ -161,7 +161,7 @@ These are used for structuring fields in the interface.
|
|||
- :class:`~wagtail.admin.edit_handlers.PageChooserPanel`
|
||||
- :class:`~wagtail.images.edit_handlers.ImageChooserPanel`
|
||||
- :class:`~wagtail.documents.edit_handlers.DocumentChooserPanel`
|
||||
- :class:`~wagtail.wagtailsnippets.edit_handlers.SnippetChooserPanel`
|
||||
- :class:`~wagtail.snippets.edit_handlers.SnippetChooserPanel`
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Here's an example snippet model:
|
|||
from django.db import models
|
||||
|
||||
from wagtail.admin.edit_handlers import FieldPanel
|
||||
from wagtail.wagtailsnippets.models import register_snippet
|
||||
from wagtail.snippets.models import register_snippet
|
||||
|
||||
...
|
||||
|
||||
|
@ -103,7 +103,7 @@ In the above example, the list of adverts is a fixed list, displayed independent
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
|
||||
from wagtail.snippets.edit_handlers import SnippetChooserPanel
|
||||
# ...
|
||||
class BookPage(Page):
|
||||
advert = models.ForeignKey(
|
||||
|
@ -130,7 +130,7 @@ To attach multiple adverts to a page, the ``SnippetChooserPanel`` can be placed
|
|||
from django.db import models
|
||||
|
||||
from wagtail.core.models import Page, Orderable
|
||||
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
|
||||
from wagtail.snippets.edit_handlers import SnippetChooserPanel
|
||||
|
||||
from modelcluster.fields import ParentalKey
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ A control to allow the editor to select an existing image, or upload a new one.
|
|||
SnippetChooserBlock
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``wagtail.wagtailsnippets.blocks.SnippetChooserBlock``
|
||||
``wagtail.snippets.blocks.SnippetChooserBlock``
|
||||
|
||||
A control to allow the editor to select a snippet object. Requires one positional argument: the snippet class to choose from. The keyword argument ``required`` (default: True) is accepted.
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ var apps = [
|
|||
new App('wagtail/documents'),
|
||||
new App('wagtail/embeds'),
|
||||
new App('wagtail/images'),
|
||||
new App('wagtail/wagtailsnippets'),
|
||||
new App('wagtail/snippets'),
|
||||
new App('wagtail/wagtailusers'),
|
||||
new App('wagtail/contrib/wagtailstyleguide'),
|
||||
new App('wagtail/contrib/settings', {
|
||||
|
|
|
@ -453,7 +453,7 @@ class ModelAdmin(WagtailRegisterable):
|
|||
for a model to be assigned to groups in settings. This is only required
|
||||
if the model isn't a Page model, and isn't registered as a Snippet
|
||||
"""
|
||||
from wagtail.wagtailsnippets.models import SNIPPET_MODELS
|
||||
from wagtail.snippets.models import SNIPPET_MODELS
|
||||
if not self.is_pagemodel and self.model not in SNIPPET_MODELS:
|
||||
return self.permission_helper.get_all_model_permissions()
|
||||
return Permission.objects.none()
|
||||
|
|
|
@ -13,7 +13,7 @@ from wagtail.admin.widgets import (
|
|||
from wagtail.core.models import Page
|
||||
from wagtail.documents.widgets import AdminDocumentChooser
|
||||
from wagtail.images.widgets import AdminImageChooser
|
||||
from wagtail.wagtailsnippets.widgets import AdminSnippetChooser
|
||||
from wagtail.snippets.widgets import AdminSnippetChooser
|
||||
|
||||
|
||||
class ExampleForm(forms.Form):
|
||||
|
|
|
@ -34,7 +34,7 @@ INSTALLED_APPS = [
|
|||
'wagtail.embeds',
|
||||
'wagtail.sites',
|
||||
'wagtail.wagtailusers',
|
||||
'wagtail.wagtailsnippets',
|
||||
'wagtail.snippets',
|
||||
'wagtail.documents',
|
||||
'wagtail.images',
|
||||
'wagtail.search',
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
default_app_config = 'wagtail.snippets.apps.WagtailSnippetsAppConfig'
|
|
@ -4,6 +4,6 @@ from django.apps import AppConfig
|
|||
|
||||
|
||||
class WagtailSnippetsAppConfig(AppConfig):
|
||||
name = 'wagtail.wagtailsnippets'
|
||||
name = 'wagtail.snippets'
|
||||
label = 'wagtailsnippets'
|
||||
verbose_name = "Wagtail snippets"
|
|
@ -17,7 +17,7 @@ class SnippetChooserBlock(ChooserBlock):
|
|||
|
||||
@cached_property
|
||||
def widget(self):
|
||||
from wagtail.wagtailsnippets.widgets import AdminSnippetChooser
|
||||
from wagtail.snippets.widgets import AdminSnippetChooser
|
||||
return AdminSnippetChooser(self.target_model)
|
||||
|
||||
class Meta:
|
|
@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
|
||||
from django.contrib.auth import get_permission_codename
|
||||
|
||||
from wagtail.wagtailsnippets.models import get_snippet_models
|
||||
from wagtail.snippets.models import get_snippet_models
|
||||
|
||||
|
||||
def get_permission_name(action, model):
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue