Clarify '# ...' comments when omitting code in tutorial snippets

See https://groups.google.com/d/msg/wagtail/NFFqKY98jiY/XZjmk3-mBAAJ
pull/3133/merge
Matt Westcott 2016-12-01 13:42:23 +00:00
rodzic cc299d8873
commit f54498b3b0
1 zmienionych plików z 12 dodań i 3 usunięć

Wyświetl plik

@ -220,7 +220,7 @@ Now we need a model and template for our blog posts. In ``blog/models.py``:
from wagtail.wagtailsearch import index
# ...
# Keep the definition of BlogIndexPage, and add:
class BlogPage(Page):
@ -401,6 +401,8 @@ Add a new ``BlogPageGalleryImage`` model to ``models.py``:
from django.db import models
# New imports added for ParentalKey, Orderable, InlinePanel, ImageChooserPanel
from modelcluster.fields import ParentalKey
from wagtail.wagtailcore.models import Page, Orderable
@ -409,7 +411,9 @@ Add a new ``BlogPageGalleryImage`` model to ``models.py``:
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailsearch import index
# ...
# ... (Keep the definition of BlogIndexPage, and update BlogPage:)
class BlogPage(Page):
date = models.DateField("Post date")
@ -558,6 +562,8 @@ First, alter ``models.py`` once more:
from django.db import models
# New imports added for ClusterTaggableManager, TaggedItemBase, MultiFieldPanel
from modelcluster.fields import ParentalKey
from modelcluster.tags import ClusterTaggableManager
from taggit.models import TaggedItemBase
@ -569,6 +575,9 @@ First, alter ``models.py`` once more:
from wagtail.wagtailsearch import index
# ... (Keep the definition of BlogIndexPage)
class BlogPageTag(TaggedItemBase):
content_object = ParentalKey('BlogPage', related_name='tagged_items')
@ -579,7 +588,7 @@ First, alter ``models.py`` once more:
body = RichTextField(blank=True)
tags = ClusterTaggableManager(through=BlogPageTag, blank=True)
# ...
# ... (Keep the main_image method and search_fields definition)
content_panels = Page.content_panels + [
MultiFieldPanel([