0001_initial.py 15 KB

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