0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

2 => 4 spaces

This commit is contained in:
Karl Hobley 2015-05-14 22:33:24 +01:00
parent b92b1f7edb
commit 3f780a1d8c

View File

@ -204,7 +204,7 @@ DocumentChooserPanel
related_name='+'
)
BookPage.content_panels = Page.content_panels + [
content_panels = Page.content_panels + [
DocumentChooserPanel('book_file'),
]
@ -220,7 +220,7 @@ SnippetChooserPanel
.. code-block:: python
from wagtail.wagtailsnippets.edit_handlers import SnippetChooserPanel
# ...
class BookPage(Page):
advert = models.ForeignKey(
'demo.Advert',
@ -230,7 +230,7 @@ SnippetChooserPanel
related_name='+'
)
content_panels = [
content_panels = Page.content_panels + [
SnippetChooserPanel('advert', Advert),
]
@ -324,7 +324,6 @@ The ``MultiFieldPanel`` groups a list of child fields into a fieldset, which can
heading="Collection of Book Fields",
classname="collapsible collapsed"
),
# ...
]
By default, ``MultiFieldPanel`` s are expanded and not collapsible. Adding the classname ``collapsible`` will enable the collapse control. Adding both ``collapsible`` and ``collapsed`` to the classname parameter will load the editor page with the ``MultiFieldPanel`` collapsed under its heading.
@ -367,7 +366,7 @@ Let's look at the example of adding related links to a ``Page``-derived model. W
# ...
content_panels = Page.content_panels + [
InlinePanel( 'related_links', label="Related Links" ),
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 ``InlinePanel`` to provide an interface for it all. Let's look again at the parameters that ``InlinePanel`` accepts: