-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modifies BakeryDemo guide for new ImageBlock
- Loading branch information
Showing
7 changed files
with
1,006 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
369 changes: 369 additions & 0 deletions
369
bakerydemo/base/migrations/0021_alter_footertext_locale_alter_formpage_body_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,369 @@ | ||
# Generated by Django 4.2.13 on 2024-07-26 09:59 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("wagtailcore", "0094_alter_page_locale"), | ||
("base", "0020_alter_footertext_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="footertext", | ||
name="locale", | ||
field=models.ForeignKey( | ||
editable=False, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
related_name="+", | ||
to="wagtailcore.locale", | ||
verbose_name="locale", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="formpage", | ||
name="body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
("heading_block", 2), | ||
("paragraph_block", 3), | ||
("image_block", 7), | ||
("block_quote", 10), | ||
("embed_block", 11), | ||
], | ||
block_lookup={ | ||
0: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"form_classname": "title", "required": True}, | ||
), | ||
1: ( | ||
"wagtail.blocks.ChoiceBlock", | ||
[], | ||
{ | ||
"blank": True, | ||
"choices": [ | ||
("", "Select a header size"), | ||
("h2", "H2"), | ||
("h3", "H3"), | ||
("h4", "H4"), | ||
], | ||
"required": False, | ||
}, | ||
), | ||
2: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("heading_text", 0), ("size", 1)]], | ||
{}, | ||
), | ||
3: ( | ||
"wagtail.blocks.RichTextBlock", | ||
(), | ||
{"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, | ||
), | ||
4: ( | ||
"wagtail.images.blocks.ImageChooserBlock", | ||
(), | ||
{"required": True}, | ||
), | ||
5: ( | ||
"wagtail.blocks.BooleanBlock", | ||
(), | ||
{ | ||
"default": False, | ||
"label": "Image is decorative", | ||
"required": False, | ||
}, | ||
), | ||
6: ("wagtail.blocks.CharBlock", (), {"required": False}), | ||
7: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("image", 4), ("decorative", 5), ("alt_text", 6)]], | ||
{}, | ||
), | ||
8: ("wagtail.blocks.TextBlock", (), {}), | ||
9: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"blank": True, "label": "e.g. Mary Berry", "required": False}, | ||
), | ||
10: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("text", 8), ("attribute_name", 9)]], | ||
{}, | ||
), | ||
11: ( | ||
"wagtail.embeds.blocks.EmbedBlock", | ||
(), | ||
{ | ||
"help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", | ||
"icon": "media", | ||
"template": "blocks/embed_block.html", | ||
}, | ||
), | ||
}, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="gallerypage", | ||
name="body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
("heading_block", 2), | ||
("paragraph_block", 3), | ||
("image_block", 7), | ||
("block_quote", 10), | ||
("embed_block", 11), | ||
], | ||
blank=True, | ||
block_lookup={ | ||
0: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"form_classname": "title", "required": True}, | ||
), | ||
1: ( | ||
"wagtail.blocks.ChoiceBlock", | ||
[], | ||
{ | ||
"blank": True, | ||
"choices": [ | ||
("", "Select a header size"), | ||
("h2", "H2"), | ||
("h3", "H3"), | ||
("h4", "H4"), | ||
], | ||
"required": False, | ||
}, | ||
), | ||
2: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("heading_text", 0), ("size", 1)]], | ||
{}, | ||
), | ||
3: ( | ||
"wagtail.blocks.RichTextBlock", | ||
(), | ||
{"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, | ||
), | ||
4: ( | ||
"wagtail.images.blocks.ImageChooserBlock", | ||
(), | ||
{"required": True}, | ||
), | ||
5: ( | ||
"wagtail.blocks.BooleanBlock", | ||
(), | ||
{ | ||
"default": False, | ||
"label": "Image is decorative", | ||
"required": False, | ||
}, | ||
), | ||
6: ("wagtail.blocks.CharBlock", (), {"required": False}), | ||
7: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("image", 4), ("decorative", 5), ("alt_text", 6)]], | ||
{}, | ||
), | ||
8: ("wagtail.blocks.TextBlock", (), {}), | ||
9: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"blank": True, "label": "e.g. Mary Berry", "required": False}, | ||
), | ||
10: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("text", 8), ("attribute_name", 9)]], | ||
{}, | ||
), | ||
11: ( | ||
"wagtail.embeds.blocks.EmbedBlock", | ||
(), | ||
{ | ||
"help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", | ||
"icon": "media", | ||
"template": "blocks/embed_block.html", | ||
}, | ||
), | ||
}, | ||
verbose_name="Page body", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="homepage", | ||
name="body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
("heading_block", 2), | ||
("paragraph_block", 3), | ||
("image_block", 7), | ||
("block_quote", 10), | ||
("embed_block", 11), | ||
], | ||
blank=True, | ||
block_lookup={ | ||
0: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"form_classname": "title", "required": True}, | ||
), | ||
1: ( | ||
"wagtail.blocks.ChoiceBlock", | ||
[], | ||
{ | ||
"blank": True, | ||
"choices": [ | ||
("", "Select a header size"), | ||
("h2", "H2"), | ||
("h3", "H3"), | ||
("h4", "H4"), | ||
], | ||
"required": False, | ||
}, | ||
), | ||
2: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("heading_text", 0), ("size", 1)]], | ||
{}, | ||
), | ||
3: ( | ||
"wagtail.blocks.RichTextBlock", | ||
(), | ||
{"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, | ||
), | ||
4: ( | ||
"wagtail.images.blocks.ImageChooserBlock", | ||
(), | ||
{"required": True}, | ||
), | ||
5: ( | ||
"wagtail.blocks.BooleanBlock", | ||
(), | ||
{ | ||
"default": False, | ||
"label": "Image is decorative", | ||
"required": False, | ||
}, | ||
), | ||
6: ("wagtail.blocks.CharBlock", (), {"required": False}), | ||
7: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("image", 4), ("decorative", 5), ("alt_text", 6)]], | ||
{}, | ||
), | ||
8: ("wagtail.blocks.TextBlock", (), {}), | ||
9: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"blank": True, "label": "e.g. Mary Berry", "required": False}, | ||
), | ||
10: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("text", 8), ("attribute_name", 9)]], | ||
{}, | ||
), | ||
11: ( | ||
"wagtail.embeds.blocks.EmbedBlock", | ||
(), | ||
{ | ||
"help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", | ||
"icon": "media", | ||
"template": "blocks/embed_block.html", | ||
}, | ||
), | ||
}, | ||
verbose_name="Home content block", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="standardpage", | ||
name="body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
("heading_block", 2), | ||
("paragraph_block", 3), | ||
("image_block", 7), | ||
("block_quote", 10), | ||
("embed_block", 11), | ||
], | ||
blank=True, | ||
block_lookup={ | ||
0: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"form_classname": "title", "required": True}, | ||
), | ||
1: ( | ||
"wagtail.blocks.ChoiceBlock", | ||
[], | ||
{ | ||
"blank": True, | ||
"choices": [ | ||
("", "Select a header size"), | ||
("h2", "H2"), | ||
("h3", "H3"), | ||
("h4", "H4"), | ||
], | ||
"required": False, | ||
}, | ||
), | ||
2: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("heading_text", 0), ("size", 1)]], | ||
{}, | ||
), | ||
3: ( | ||
"wagtail.blocks.RichTextBlock", | ||
(), | ||
{"icon": "pilcrow", "template": "blocks/paragraph_block.html"}, | ||
), | ||
4: ( | ||
"wagtail.images.blocks.ImageChooserBlock", | ||
(), | ||
{"required": True}, | ||
), | ||
5: ( | ||
"wagtail.blocks.BooleanBlock", | ||
(), | ||
{ | ||
"default": False, | ||
"label": "Image is decorative", | ||
"required": False, | ||
}, | ||
), | ||
6: ("wagtail.blocks.CharBlock", (), {"required": False}), | ||
7: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("image", 4), ("decorative", 5), ("alt_text", 6)]], | ||
{}, | ||
), | ||
8: ("wagtail.blocks.TextBlock", (), {}), | ||
9: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"blank": True, "label": "e.g. Mary Berry", "required": False}, | ||
), | ||
10: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("text", 8), ("attribute_name", 9)]], | ||
{}, | ||
), | ||
11: ( | ||
"wagtail.embeds.blocks.EmbedBlock", | ||
(), | ||
{ | ||
"help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks", | ||
"icon": "media", | ||
"template": "blocks/embed_block.html", | ||
}, | ||
), | ||
}, | ||
verbose_name="Page body", | ||
), | ||
), | ||
] |
Oops, something went wrong.