2
0

0008_alter_blogpage_body.py 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Generated by Django 5.1.8 on 2025-06-19 13:28
  2. import wagtail.fields
  3. from django.db import migrations
  4. class Migration(migrations.Migration):
  5. dependencies = [
  6. ("blog", "0007_alter_blogpage_body"),
  7. ]
  8. operations = [
  9. migrations.AlterField(
  10. model_name="blogpage",
  11. name="body",
  12. field=wagtail.fields.StreamField(
  13. [
  14. ("heading_block", 2),
  15. ("paragraph_block", 3),
  16. ("image_block", 6),
  17. ("block_quote", 9),
  18. ("embed_block", 10),
  19. ],
  20. blank=True,
  21. block_lookup={
  22. 0: (
  23. "wagtail.blocks.CharBlock",
  24. (),
  25. {"form_classname": "title", "required": True},
  26. ),
  27. 1: (
  28. "wagtail.blocks.ChoiceBlock",
  29. [],
  30. {
  31. "blank": True,
  32. "choices": [
  33. ("", "Select a header size"),
  34. ("h2", "H2"),
  35. ("h3", "H3"),
  36. ("h4", "H4"),
  37. ],
  38. "required": False,
  39. },
  40. ),
  41. 2: (
  42. "wagtail.blocks.StructBlock",
  43. [[("heading_text", 0), ("size", 1)]],
  44. {},
  45. ),
  46. 3: (
  47. "bakerydemo.base.blocks.CustomRichTextBlock",
  48. (),
  49. {
  50. "description": "A rich text paragraph",
  51. "icon": "pilcrow",
  52. "preview_value": '\n <h2>Our bread pledge</h2>\n <p>As a bakery, <b>breads</b> have <i>always</i> been in our hearts.\n <a href="https://en.wikipedia.org/wiki/Staple_food">Staple foods</a>\n are essential for society, and – bread is the tastiest of all.\n We love to transform batters and doughs into baked goods with a firm\n dry crust and fluffy center.</p>\n ',
  53. "template": "blocks/paragraph_block.html",
  54. },
  55. ),
  56. 4: (
  57. "wagtail.images.blocks.ImageChooserBlock",
  58. (),
  59. {"required": True},
  60. ),
  61. 5: ("wagtail.blocks.CharBlock", (), {"required": False}),
  62. 6: (
  63. "wagtail.blocks.StructBlock",
  64. [[("image", 4), ("caption", 5), ("attribution", 5)]],
  65. {},
  66. ),
  67. 7: ("wagtail.blocks.TextBlock", (), {}),
  68. 8: (
  69. "wagtail.blocks.CharBlock",
  70. (),
  71. {"blank": True, "label": "e.g. Mary Berry", "required": False},
  72. ),
  73. 9: (
  74. "wagtail.blocks.StructBlock",
  75. [[("text", 7), ("attribute_name", 8)]],
  76. {},
  77. ),
  78. 10: (
  79. "bakerydemo.base.blocks.CustomEmbedBlock",
  80. (),
  81. {
  82. "description": "An embedded video or other media",
  83. "help_text": "Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",
  84. "icon": "media",
  85. "preview_template": "base/preview/static_embed_block.html",
  86. "preview_value": "https://www.youtube.com/watch?v=mwrGSfiB1Mg",
  87. "template": "blocks/embed_block.html",
  88. },
  89. ),
  90. },
  91. verbose_name="Page body",
  92. ),
  93. ),
  94. ]