2
0

0001_initial.py 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. # -*- coding: utf-8 -*-
  2. # Generated by Django 1.10.5 on 2017-03-15 07:16
  3. from __future__ import unicode_literals
  4. from django.db import migrations, models
  5. import django.db.models.deletion
  6. import modelcluster.fields
  7. import wagtail.blocks
  8. import wagtail.fields
  9. import wagtail.embeds.blocks
  10. import wagtail.images.blocks
  11. class Migration(migrations.Migration):
  12. initial = True
  13. dependencies = [
  14. ("wagtailcore", "0032_add_bulk_delete_page_permission"),
  15. ("wagtailimages", "0018_remove_rendition_filter"),
  16. ]
  17. operations = [
  18. migrations.CreateModel(
  19. name="BreadIngredient",
  20. fields=[
  21. (
  22. "id",
  23. models.AutoField(
  24. auto_created=True,
  25. primary_key=True,
  26. serialize=False,
  27. verbose_name="ID",
  28. ),
  29. ),
  30. ("name", models.CharField(max_length=255)),
  31. ],
  32. options={
  33. "verbose_name_plural": "Bread ingredients",
  34. },
  35. ),
  36. migrations.CreateModel(
  37. name="BreadPage",
  38. fields=[
  39. (
  40. "page_ptr",
  41. models.OneToOneField(
  42. auto_created=True,
  43. on_delete=django.db.models.deletion.CASCADE,
  44. parent_link=True,
  45. primary_key=True,
  46. serialize=False,
  47. to="wagtailcore.Page",
  48. ),
  49. ),
  50. (
  51. "introduction",
  52. models.TextField(blank=True, help_text="Text to describe the page"),
  53. ),
  54. (
  55. "body",
  56. wagtail.fields.StreamField(
  57. (
  58. (
  59. "heading_block",
  60. wagtail.blocks.StructBlock(
  61. (
  62. (
  63. "heading_text",
  64. wagtail.blocks.CharBlock(
  65. classname="title", required=True
  66. ),
  67. ),
  68. (
  69. "size",
  70. wagtail.blocks.ChoiceBlock(
  71. blank=True,
  72. choices=[
  73. ("", "Select a header size"),
  74. ("h2", "H2"),
  75. ("h3", "H3"),
  76. ("h4", "H4"),
  77. ],
  78. required=False,
  79. ),
  80. ),
  81. )
  82. ),
  83. ),
  84. (
  85. "paragraph_block",
  86. wagtail.blocks.RichTextBlock(
  87. icon="fa-paragraph",
  88. template="blocks/paragraph_block.html",
  89. ),
  90. ),
  91. (
  92. "image_block",
  93. wagtail.blocks.StructBlock(
  94. (
  95. (
  96. "image",
  97. wagtail.images.blocks.ImageChooserBlock(
  98. required=True
  99. ),
  100. ),
  101. (
  102. "caption",
  103. wagtail.blocks.CharBlock(required=False),
  104. ),
  105. (
  106. "attribution",
  107. wagtail.blocks.CharBlock(required=False),
  108. ),
  109. )
  110. ),
  111. ),
  112. (
  113. "block_quote",
  114. wagtail.blocks.StructBlock(
  115. (
  116. ("text", wagtail.blocks.TextBlock()),
  117. (
  118. "attribute_name",
  119. wagtail.blocks.CharBlock(
  120. blank=True,
  121. label="e.g. Guy Picciotto",
  122. required=False,
  123. ),
  124. ),
  125. )
  126. ),
  127. ),
  128. (
  129. "embed_block",
  130. wagtail.embeds.blocks.EmbedBlock(
  131. help_text="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
  132. icon="fa-s15",
  133. template="blocks/embed_block.html",
  134. ),
  135. ),
  136. ),
  137. blank=True,
  138. verbose_name="Page body",
  139. ),
  140. ),
  141. ],
  142. options={
  143. "abstract": False,
  144. },
  145. bases=("wagtailcore.page", models.Model),
  146. ),
  147. migrations.CreateModel(
  148. name="BreadsIndexPage",
  149. fields=[
  150. (
  151. "page_ptr",
  152. models.OneToOneField(
  153. auto_created=True,
  154. on_delete=django.db.models.deletion.CASCADE,
  155. parent_link=True,
  156. primary_key=True,
  157. serialize=False,
  158. to="wagtailcore.Page",
  159. ),
  160. ),
  161. (
  162. "introduction",
  163. models.TextField(blank=True, help_text="Text to describe the page"),
  164. ),
  165. (
  166. "body",
  167. wagtail.fields.StreamField(
  168. (
  169. (
  170. "heading_block",
  171. wagtail.blocks.StructBlock(
  172. (
  173. (
  174. "heading_text",
  175. wagtail.blocks.CharBlock(
  176. classname="title", required=True
  177. ),
  178. ),
  179. (
  180. "size",
  181. wagtail.blocks.ChoiceBlock(
  182. blank=True,
  183. choices=[
  184. ("", "Select a header size"),
  185. ("h2", "H2"),
  186. ("h3", "H3"),
  187. ("h4", "H4"),
  188. ],
  189. required=False,
  190. ),
  191. ),
  192. )
  193. ),
  194. ),
  195. (
  196. "paragraph_block",
  197. wagtail.blocks.RichTextBlock(
  198. icon="fa-paragraph",
  199. template="blocks/paragraph_block.html",
  200. ),
  201. ),
  202. (
  203. "image_block",
  204. wagtail.blocks.StructBlock(
  205. (
  206. (
  207. "image",
  208. wagtail.images.blocks.ImageChooserBlock(
  209. required=True
  210. ),
  211. ),
  212. (
  213. "caption",
  214. wagtail.blocks.CharBlock(required=False),
  215. ),
  216. (
  217. "attribution",
  218. wagtail.blocks.CharBlock(required=False),
  219. ),
  220. )
  221. ),
  222. ),
  223. (
  224. "block_quote",
  225. wagtail.blocks.StructBlock(
  226. (
  227. ("text", wagtail.blocks.TextBlock()),
  228. (
  229. "attribute_name",
  230. wagtail.blocks.CharBlock(
  231. blank=True,
  232. label="e.g. Guy Picciotto",
  233. required=False,
  234. ),
  235. ),
  236. )
  237. ),
  238. ),
  239. (
  240. "embed_block",
  241. wagtail.embeds.blocks.EmbedBlock(
  242. help_text="Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks",
  243. icon="fa-s15",
  244. template="blocks/embed_block.html",
  245. ),
  246. ),
  247. ),
  248. blank=True,
  249. verbose_name="Page body",
  250. ),
  251. ),
  252. (
  253. "image",
  254. models.ForeignKey(
  255. blank=True,
  256. help_text="Landscape mode only; horizontal width between 1000px and 3000px.",
  257. null=True,
  258. on_delete=django.db.models.deletion.SET_NULL,
  259. related_name="+",
  260. to="wagtailimages.Image",
  261. ),
  262. ),
  263. ],
  264. options={
  265. "abstract": False,
  266. },
  267. bases=("wagtailcore.page", models.Model),
  268. ),
  269. migrations.CreateModel(
  270. name="BreadType",
  271. fields=[
  272. (
  273. "id",
  274. models.AutoField(
  275. auto_created=True,
  276. primary_key=True,
  277. serialize=False,
  278. verbose_name="ID",
  279. ),
  280. ),
  281. ("title", models.CharField(max_length=255)),
  282. ],
  283. options={
  284. "verbose_name_plural": "Bread types",
  285. },
  286. ),
  287. migrations.CreateModel(
  288. name="Country",
  289. fields=[
  290. (
  291. "id",
  292. models.AutoField(
  293. auto_created=True,
  294. primary_key=True,
  295. serialize=False,
  296. verbose_name="ID",
  297. ),
  298. ),
  299. ("title", models.CharField(max_length=100)),
  300. ],
  301. options={
  302. "verbose_name_plural": "Countries of Origin",
  303. },
  304. ),
  305. migrations.AddField(
  306. model_name="breadpage",
  307. name="bread_type",
  308. field=models.ForeignKey(
  309. blank=True,
  310. null=True,
  311. on_delete=django.db.models.deletion.SET_NULL,
  312. related_name="+",
  313. to="breads.BreadType",
  314. ),
  315. ),
  316. migrations.AddField(
  317. model_name="breadpage",
  318. name="image",
  319. field=models.ForeignKey(
  320. blank=True,
  321. help_text="Landscape mode only; horizontal width between 1000px and 3000px.",
  322. null=True,
  323. on_delete=django.db.models.deletion.SET_NULL,
  324. related_name="+",
  325. to="wagtailimages.Image",
  326. ),
  327. ),
  328. migrations.AddField(
  329. model_name="breadpage",
  330. name="ingredients",
  331. field=modelcluster.fields.ParentalManyToManyField(
  332. blank=True, to="breads.BreadIngredient"
  333. ),
  334. ),
  335. migrations.AddField(
  336. model_name="breadpage",
  337. name="origin",
  338. field=models.ForeignKey(
  339. blank=True,
  340. null=True,
  341. on_delete=django.db.models.deletion.SET_NULL,
  342. to="breads.Country",
  343. ),
  344. ),
  345. ]