kopia lustrzana https://github.com/wagtail/bakerydemo
adding some basic docstrings to classes that did not have them
rodzic
363189ca2d
commit
f9b3d6f8d0
|
@ -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",
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Ładowanie…
Reference in New Issue