How to use the wagtail.core 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 bashu / wagtail-metadata-mixin / example / puput_migrations / 0001_initial.py View on Github external
(
                    "page_ptr",
                    models.OneToOneField(
                        parent_link=True,
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        to="wagtailcore.Page",
                        on_delete=models.CASCADE,
                    ),
                ),
                ("body", wagtail.core.fields.RichTextField(verbose_name="body")),
                ("date", models.DateTimeField(default=datetime.datetime.today, verbose_name="Post date")),
                (
                    "excerpt",
                    wagtail.core.fields.RichTextField(
                        help_text="Used to display on puput pages list. If this field is not filled, a truncate version of body text will be used.",
                        verbose_name="excerpt",
                        blank=True,
                    ),
                ),
                ("num_comments", models.IntegerField(default=0, editable=False)),
                (
                    "categories",
                    models.ManyToManyField(to="puput.Category", through="puput.CategoryEntryPage", blank=True),
                ),
                (
                    "header_image",
                    models.ForeignKey(
                        related_name="+",
                        on_delete=django.db.models.deletion.SET_NULL,
                        verbose_name="Header image",
github ea-czech-republic / efektivnialtruismus.cz / website / theses / migrations / 0011_thesisindexpage_header.py View on Github external
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks


class Migration(migrations.Migration):

    dependencies = [
        ('theses', '0010_thesisindexpage_propose'),
    ]

    operations = [
        migrations.AddField(
            model_name='thesisindexpage',
            name='header',
            field=wagtail.core.fields.StreamField((('rawHtml', wagtail.core.blocks.RawHTMLBlock()), ('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('embed', wagtail.embeds.blocks.EmbedBlock())), default=None),
            preserve_default=False,
        ),
github wagtail / bakerydemo / bakerydemo / base / migrations / 0002_auto_20170329_0055.py View on Github external
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks


class Migration(migrations.Migration):

    dependencies = [
        ('base', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='formpage',
            name='body',
            field=wagtail.core.fields.StreamField((('heading_block', wagtail.core.blocks.StructBlock((('heading_text', wagtail.core.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.core.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.core.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.CharBlock(required=False)), ('attribution', wagtail.core.blocks.CharBlock(required=False))))), ('block_quote', wagtail.core.blocks.StructBlock((('text', wagtail.core.blocks.TextBlock()), ('attribute_name', wagtail.core.blocks.CharBlock(blank=True, label='e.g. Mary Berry', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html')))),
        ),
        migrations.AlterField(
            model_name='gallerypage',
            name='body',
            field=wagtail.core.fields.StreamField((('heading_block', wagtail.core.blocks.StructBlock((('heading_text', wagtail.core.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.core.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.core.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.CharBlock(required=False)), ('attribution', wagtail.core.blocks.CharBlock(required=False))))), ('block_quote', wagtail.core.blocks.StructBlock((('text', wagtail.core.blocks.TextBlock()), ('attribute_name', wagtail.core.blocks.CharBlock(blank=True, label='e.g. Mary Berry', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body'),
        ),
        migrations.AlterField(
            model_name='homepage',
            name='body',
            field=wagtail.core.fields.StreamField((('heading_block', wagtail.core.blocks.StructBlock((('heading_text', wagtail.core.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.core.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.core.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.CharBlock(required=False)), ('attribution', wagtail.core.blocks.CharBlock(required=False))))), ('block_quote', wagtail.core.blocks.StructBlock((('text', wagtail.core.blocks.TextBlock()), ('attribute_name', wagtail.core.blocks.CharBlock(blank=True, label='e.g. Mary Berry', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Home content block'),
        ),
        migrations.AlterField(
            model_name='standardpage',
            name='body',
            field=wagtail.core.fields.StreamField((('heading_block', wagtail.core.blocks.StructBlock((('heading_text', wagtail.core.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.core.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.core.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.CharBlock(required=False)), ('attribution', wagtail.core.blocks.CharBlock(required=False))))), ('block_quote', wagtail.core.blocks.StructBlock((('text', wagtail.core.blocks.TextBlock()), ('attribute_name', wagtail.core.blocks.CharBlock(blank=True, label='e.g. Mary Berry', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body'),
        ),
github Frojd / wagtail-geo-widget / example / geopage_nospatial / migrations / 0001_initial.py View on Github external
name='StandardPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('address', models.CharField(blank=True, max_length=250, null=True)),
                ('location', models.CharField(blank=True, max_length=250, null=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='StreamPage',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('body', wagtail.core.fields.StreamField((('map', wagtailgeowidget.blocks.GeoBlock()), ('map_struct', wagtail.core.blocks.StructBlock((('address', wagtail.core.blocks.CharBlock(required=True)),), icon='user'))))),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
github mdn / developer-portal / developerportal / apps / events / migrations / 0025_update_streamblock.py View on Github external
"image",
                                    wagtail.images.blocks.ImageChooserBlock(
                                        help_text="16:9 aspect-ratio image",
                                        label="16:9 image",
                                    ),
                                ),
                                (
                                    "image_3_2",
                                    wagtail.images.blocks.ImageChooserBlock(
                                        help_text="3:2 aspect-ratio image - optional but recommended",
                                        required=False,
                                    ),
                                ),
                                (
                                    "url",
                                    wagtail.core.blocks.URLBlock(
                                        label="URL", required=False
                                    ),
                                ),
                            ]
                        ),
                    ),
                ],
                blank=True,
                help_text="Optional list of speakers for this event",
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="events",
            name="featured",
            field=wagtail.core.fields.StreamField(
github mdn / developer-portal / developerportal / apps / home / migrations / 0010_auto_20190627_1527.py View on Github external
# Generated by Django 2.2.1 on 2019-06-27 15:27

from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields


class Migration(migrations.Migration):

    dependencies = [("home", "0009_homepage_featured")]

    operations = [
        migrations.AlterField(
            model_name="homepage",
            name="featured",
            field=wagtail.core.fields.StreamField(
                [
                    (
                        "article",
                        wagtail.core.blocks.PageChooserBlock(
                            page_type=["articles.Article"], required=False
                        ),
                    )
                ],
                blank=True,
                null=True,
            ),
github Frojd / Wagtail-Pipit / Company-Project / src / main / migrations / 0001_initial.py View on Github external
('twitter_title', models.CharField(blank=True, help_text='Fallbacks to facebook title if empty', max_length=40, null=True, verbose_name='Twitter title')),
                ('twitter_description', models.CharField(blank=True, help_text='Fallbacks to facebook description if empty', max_length=300, null=True, verbose_name='Twitter description')),
                ('robot_noindex', models.BooleanField(default=False, help_text='Check to add noindex to robots', verbose_name='No index')),
                ('robot_nofollow', models.BooleanField(default=False, help_text='Check to add nofollow to robots', verbose_name='No follow')),
                ('canonical_link', models.URLField(blank=True, null=True, verbose_name='Canonical link')),
            ],
            options={
                'abstract': False,
            },
            bases=(main.mixins.EnhancedEditHandlerMixin, 'wagtailcore.page'),
        ),
        migrations.CreateModel(
            name='ArticlePage',
            fields=[
                ('basepage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.BasePage')),
                ('rich_text', wagtail.core.fields.RichTextField(blank=True, null=True, verbose_name='Rich text')),
            ],
            options={
                'verbose_name': 'Article',
            },
            bases=('main.basepage',),
        ),
        migrations.CreateModel(
            name='HomePage',
            fields=[
                ('basepage_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='main.BasePage')),
            ],
            options={
                'verbose_name': 'Home',
            },
            bases=('main.basepage',),
        ),