diff --git a/bakerydemo/base/blocks.py b/bakerydemo/base/blocks.py index 80483e6..6803330 100644 --- a/bakerydemo/base/blocks.py +++ b/bakerydemo/base/blocks.py @@ -6,6 +6,10 @@ from wagtail.wagtailcore.blocks import ( class ImageBlock(StructBlock): + """ + Custom `StructBlock` for utilizing images with associated caption and + attribution data + """ image = ImageChooserBlock(required=True) caption = CharBlock(required=False) attribution = CharBlock(required=False) @@ -16,6 +20,9 @@ class ImageBlock(StructBlock): class HeadingBlock(StructBlock): + """ + Custom `StructBlock` that allows the user to select h2 - h4 sizes for headers + """ heading_text = CharBlock(classname="title", required=True) size = ChoiceBlock(choices=[ ('', 'Select a header size'), @@ -30,6 +37,9 @@ class HeadingBlock(StructBlock): class BlockQuote(StructBlock): + """ + Custom `StructBlock` that allows the user to attribute a quote to the author + """ text = TextBlock(), attribute_name = CharBlock( blank=True, required=False, label='e.g. Guy Picciotto') @@ -41,6 +51,9 @@ class BlockQuote(StructBlock): # StreamBlocks class BaseStreamBlock(StreamBlock): + """ + Define the custom blocks that `StreamField` will utilize + """ heading_block = HeadingBlock() paragraph_block = RichTextBlock( icon="fa-paragraph", diff --git a/bakerydemo/base/models.py b/bakerydemo/base/models.py index 3fd8aa9..7ebf0f6 100644 --- a/bakerydemo/base/models.py +++ b/bakerydemo/base/models.py @@ -23,6 +23,10 @@ from .blocks import BaseStreamBlock @register_snippet class People(ClusterableModel): + """ + `People` snippets are secondary content objects that do not require their + own full webpage to render. + """ first_name = models.CharField("First name", max_length=254) last_name = models.CharField("Last name", max_length=254) job_title = models.CharField("Job title", max_length=254) @@ -66,6 +70,9 @@ class People(ClusterableModel): @register_snippet class FooterText(models.Model): + """ + This provides editable text for the site footer + """ body = RichTextField() panels = [