How to use the wagtail.wagtailcore.blocks.CharBlock function in wagtail

To help you get started, we’ve selected a few wagtail examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liqd / a4-opin / home / models.py View on Github external
class Meta:
        template = 'home/blocks/inline_images_block.html'
        icon = 'placeholder'
        label = 'Inline Images Block'


class CallToActionBlock(core_blocks.StructBlock):
    internal_link = core_blocks.PageChooserBlock(required=False)
    external_link = core_blocks.URLBlock(required=False)
    link_text = core_blocks.TextBlock(required=False)


class InfoBlock(core_blocks.StructBlock):

    title = core_blocks.CharBlock(classname="full title", required=False)
    image = image_blocks.ImageChooserBlock(required=False)
    text = core_blocks.RichTextBlock(required=False)
    button = CallToActionBlock(required=False)
    highlight = core_blocks.ChoiceBlock(choices=[
        ('', 'None'),
        ('highlight', 'Highlight (blue)'),
        ('boxed', 'Boxed'),
        ('boxed2', 'Boxed Variation'),
        ('highlight-purple', 'Highlight (purple)')
    ], icon='cup',
        required=False,
        help_text='How should this block be displayed?'
    )
    alignment = core_blocks.ChoiceBlock(
        choices=[
            ('vertical', 'vertical'),
github CIGIHub / opencanada / core / migrations / 0021_streampage.py View on Github external
import articles.fields
import interactives.models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0020_assign_theme_to_homepage'),
    ]

    operations = [
        migrations.CreateModel(
            name='StreamPage',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('body', articles.fields.BodyField([('Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), ('Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), ('Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('nocrop', 'Full Width - No Cropping')])), (b'include_border', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), ('Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), ('List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), ('Sharable', articles.fields.SharableBlock()), ('PullQuote', articles.fields.PullQuoteBlock()), ('Quote', articles.fields.SimpleQuoteBlock()), ('Overflow', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('nocrop', 'Full Width - No Cropping')])), (b'include_border', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul')), (b'ColumnedContent', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('nocrop', 'Full Width - No Cropping')])), (b'include_border', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul'))], required=False))]))], required=False))])), ('FullBleed', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('nocrop', 'Full Width - No Cropping')])), (b'include_border', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul')), (b'ColumnedContent', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('nocrop', 'Full Width - No Cropping')])), (b'include_border', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul'))], required=False))]))], required=False))])), ('ColumnedContent', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('nocrop', 'Full Width - No Cropping')])), (b'include_border', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul'))], required=False))])), ('Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive, icon='cogs')), ('RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul'))])),
            ],
github liqd / a4-opin / home / blocks.py View on Github external
image = ImageChooserBlock()

    class Meta:
        template = 'home/blocks/wide_image_block.html'
        icon = 'placeholder'
        label = 'Wide Image Block'


class ContactBlock(blocks.StructBlock):

    title = CharBlock(classname="full title")
    name_label = CharBlock(classname="full title")
    email_label = CharBlock(classname="full title")
    subject_label = CharBlock(classname="full title")
    message_label = CharBlock(classname="full title")
    submit_label = CharBlock(classname="full title")

    class Meta:
        template = 'home/blocks/contact_block.html'
        icon = 'placeholder'
        label = 'Contact Block'


class AccordionItemBlock(blocks.StructBlock):
    title = TextBlock(required=False)
    content = RichTextBlock(required=False)


class AccordionBlock(blocks.StructBlock):

    accordion_items = ListBlock(AccordionItemBlock())
github torchbox / wagtail-torchbox / tbx / core / migrations / 0088_fix_wrong_parameter_in_page_chooser_block.py View on Github external
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks


class Migration(migrations.Migration):

    dependencies = [
        ('torchbox', '0087_auto_20170117_1643'),
    ]

    operations = [
        migrations.AlterField(
            model_name='servicepage',
            name='streamfield',
            field=wagtail.wagtailcore.fields.StreamField([(b'case_studies', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'case_studies', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([('page', wagtail.wagtailcore.blocks.PageChooserBlock('torchbox.WorkPage')), ('title', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('descriptive_title', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=False))])))])), (b'highlights', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'highlights', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.TextBlock()))])), (b'pull_quote', wagtail.wagtailcore.blocks.StructBlock([(b'quote', wagtail.wagtailcore.blocks.CharBlock(classname='quote title')), (b'attribution', wagtail.wagtailcore.blocks.CharBlock())], template='blocks/pull_quote_block.html')), (b'process', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'steps', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('icon', wagtail.wagtailcore.blocks.CharBlock(help_text='Paste SVG code here', max_length=9000, required=True)), ('description', wagtail.wagtailcore.blocks.TextBlock(required=True))])))])), (b'people', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'people', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock()))])), (b'featured_pages', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock()), (b'pages', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([('page', wagtail.wagtailcore.blocks.PageChooserBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('text', wagtail.wagtailcore.blocks.TextBlock()), ('sub_text', wagtail.wagtailcore.blocks.CharBlock(max_length=100))])))]))]),
        ),
github torchbox / wagtail-torchbox / tbx / core / migrations / 0075_auto_20161124_0845.py View on Github external
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields


class Migration(migrations.Migration):

    dependencies = [
        ('torchbox', '0074_servicepage'),
    ]

    operations = [
        migrations.AlterField(
            model_name='servicepage',
            name='streamfield',
            field=wagtail.wagtailcore.fields.StreamField([(b'case_studies', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'case_studies', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(['torchbox.WorkPage'])))])), (b'highlights', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'highlights', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.TextBlock()))])), (b'pull_quote', wagtail.wagtailcore.blocks.StructBlock([(b'quote', wagtail.wagtailcore.blocks.CharBlock(classname='quote title')), (b'attribution', wagtail.wagtailcore.blocks.CharBlock())], template='blocks/pull_quote_block.html')), (b'process', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'steps', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('icon', wagtail.wagtailcore.blocks.CharBlock(help_text='Paste SVG code here', max_length=9000, required=True)), ('description', wagtail.wagtailcore.blocks.TextBlock(required=True))])))])), (b'people', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'people', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock()))]))]),
        ),
github torchbox / wagtail-torchbox / tbx / core / migrations / 0078_auto_20161129_1014.py View on Github external
from django.db import migrations
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields


class Migration(migrations.Migration):

    dependencies = [
        ('torchbox', '0077_auto_20161129_1011'),
    ]

    operations = [
        migrations.AlterField(
            model_name='servicepage',
            name='streamfield',
            field=wagtail.wagtailcore.fields.StreamField([(b'case_studies', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'case_studies', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(['torchbox.WorkPage'])))])), (b'highlights', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'highlights', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.TextBlock()))])), (b'pull_quote', wagtail.wagtailcore.blocks.StructBlock([(b'quote', wagtail.wagtailcore.blocks.CharBlock(classname='quote title')), (b'attribution', wagtail.wagtailcore.blocks.CharBlock())], template='blocks/pull_quote_block.html')), (b'process', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'steps', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('icon', wagtail.wagtailcore.blocks.CharBlock(help_text='Paste SVG code here', max_length=9000, required=True)), ('description', wagtail.wagtailcore.blocks.TextBlock(required=True))])))])), (b'people', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'intro', wagtail.wagtailcore.blocks.TextBlock(required=True)), (b'people', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock()))]))]),
        ),
github TakwimuAfrica / Takwimu / takwimu / migrations / 0007_auto_20180702_1411.py View on Github external
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtailimages.blocks


class Migration(migrations.Migration):

    dependencies = [
        ('takwimu', '0006_topicpage_icon'),
    ]

    operations = [
        migrations.AddField(
            model_name='profilepage',
            name='body',
            field=wagtail.wagtailcore.fields.StreamField([(b'topic', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'icon', wagtail.wagtailimages.blocks.ImageChooserBlock(required=False)), (b'summary', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'body', wagtail.wagtailcore.blocks.RichTextBlock(required=False))]))], blank=True),
        ),
        migrations.AddField(
            model_name='profilepage',
            name='date',
            field=models.DateField(auto_now=True, null=True, verbose_name=b'Last Updated'),
        ),
github TakwimuAfrica / Takwimu / takwimu / migrations / 0011_auto_20180704_1457.py View on Github external
class Migration(migrations.Migration):

    dependencies = [
        ('takwimu', '0010_auto_20180704_1214'),
    ]

    operations = [
        migrations.AlterField(
            model_name='profilepage',
            name='body',
            field=wagtail.wagtailcore.fields.StreamField([(b'topic', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'icon', takwimu.models.dashboard.IconChoiceBlock(required=False)), (b'summary', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'body', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), (b'indicators', wagtail.wagtailcore.blocks.StreamBlock([(b'free_form', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'body', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.RichTextBlock(features=[b'link'], required=False))], icon=b'snippet', template=b'takwimu/_includes/dataview/freeform.html')), (b'data_indicator', takwimu.models.dashboard.DataIndicatorChooserBlock()), (b'embed', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'embed', wagtail.wagtailembeds.blocks.EmbedBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'media')), (b'document', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'document', wagtail.wagtaildocs.blocks.DocumentChooserBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'doc-full')), (b'image', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=False)), (b'caption', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'image')), (b'html', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'code')), (b'entities', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'entities', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([(b'name', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=False)), (b'description', wagtail.wagtailcore.blocks.TextBlock(required=False))]))), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'group'))], required=False))]))], blank=True),
        ),
        migrations.AlterField(
            model_name='profilesectionpage',
            name='body',
            field=wagtail.wagtailcore.fields.StreamField([(b'topic', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'icon', takwimu.models.dashboard.IconChoiceBlock(required=False)), (b'summary', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'body', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), (b'indicators', wagtail.wagtailcore.blocks.StreamBlock([(b'free_form', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'body', wagtail.wagtailcore.blocks.RichTextBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.RichTextBlock(features=[b'link'], required=False))], icon=b'snippet', template=b'takwimu/_includes/dataview/freeform.html')), (b'data_indicator', takwimu.models.dashboard.DataIndicatorChooserBlock()), (b'embed', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'embed', wagtail.wagtailembeds.blocks.EmbedBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'media')), (b'document', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'document', wagtail.wagtaildocs.blocks.DocumentChooserBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'doc-full')), (b'image', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=False)), (b'caption', wagtail.wagtailcore.blocks.TextBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'image')), (b'html', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'raw_html', wagtail.wagtailcore.blocks.RawHTMLBlock(required=False)), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'code')), (b'entities', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'entities', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.StructBlock([(b'name', wagtail.wagtailcore.blocks.CharBlock(required=False)), (b'image', wagtail.wagtailimages.blocks.ImageChooserBlock(required=False)), (b'description', wagtail.wagtailcore.blocks.TextBlock(required=False))]))), (b'source', wagtail.wagtailcore.blocks.URLBlock(required=False)), (b'source_date', wagtail.wagtailcore.blocks.DateBlock(required=False))], icon=b'group'))], required=False))]))], blank=True),
        ),
github CIGIHub / opencanada / articles / migrations / 0060_auto_20150925_2012.py View on Github external
('sort_order', models.IntegerField(null=True, editable=False, blank=True)),
                ('text', wagtail.wagtailcore.fields.RichTextField()),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.RemoveField(
            model_name='chapteredarticlepage',
            name='chapters',
        ),
        migrations.AddField(
            model_name='articlepage',
            name='chapters',
            field=articles.fields.ChapterField([('chapter', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock()), (b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('editorial', 'Full Width Editorial')])), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul')), (b'Overflow', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('editorial', 'Full Width Editorial')])), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul')), (b'ColumnedContent', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('editorial', 'Full Width Editorial')])), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul'))], required=False))]))], required=False))])), (b'ColumnedContent', wagtail.wagtailcore.blocks.StructBlock([(b'body', wagtail.wagtailcore.blocks.StreamBlock([(b'Heading', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.CharBlock()), (b'heading_level', wagtail.wagtailcore.blocks.ChoiceBlock(default=2, choices=[(2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6')]))])), (b'Paragraph', wagtail.wagtailcore.blocks.StructBlock([(b'text', wagtail.wagtailcore.blocks.RichTextBlock()), (b'use_dropcap', wagtail.wagtailcore.blocks.BooleanBlock(required=False))])), (b'Image', wagtail.wagtailcore.blocks.StructBlock([(b'image', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'placement', wagtail.wagtailcore.blocks.ChoiceBlock(default='full', choices=[('left', 'Left Aligned'), ('right', 'Right Aligned'), ('full', 'Full Width'), ('editorial', 'Full Width Editorial')])), (b'expandable', wagtail.wagtailcore.blocks.BooleanBlock(default=False, required=False)), (b'label', wagtail.wagtailcore.blocks.CharBlock(help_text='Additional label to be displayed with the image.', required=False))])), (b'Embed', wagtail.wagtailembeds.blocks.EmbedBlock(icon='site')), (b'List', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.RichTextBlock(label='item'), icon='list-ul')), (b'Sharable', articles.fields.SharableBlock()), (b'PullQuote', articles.fields.PullQuoteBlock()), (b'Quote', articles.fields.SimpleQuoteBlock()), (b'Interactive', articles.fields.InteractiveBlock(interactives.models.Interactive)), (b'RelatedItems', wagtail.wagtailcore.blocks.StructBlock([(b'heading', wagtail.wagtailcore.blocks.CharBlock(default='Related')), (b'items', wagtail.wagtailcore.blocks.ListBlock(wagtail.wagtailcore.blocks.PageChooserBlock(label='item')))], icon='list-ul'))], required=False))]))], required=False))]))], null=True, blank=True),
        ),
        migrations.AddField(
            model_name='articlepage',
            name='citations_heading',
            field=models.TextField(default='Works Cited', blank=True),
        ),
        migrations.AddField(
            model_name='articlepage',
            name='endnote_identifier_style',
            field=models.CharField(default='roman-lower', max_length=20, choices=[('roman-lower', 'Roman Numerals - Lowercase'), ('roman-upper', 'Roman Numerals - Uppercase'), ('numbers', 'Numbers')]),
        ),
        migrations.AddField(
            model_name='articlepage',
            name='endnotes_heading',
            field=models.TextField(default='End Notes', blank=True),
        ),