0001_initial.py 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. # -*- coding: utf-8 -*-
  2. # Generated by Django 1.10.5 on 2017-03-15 07:16
  3. from django.db import migrations, models
  4. import django.db.models.deletion
  5. import modelcluster.contrib.taggit
  6. import modelcluster.fields
  7. import wagtail.contrib.routable_page.models
  8. import wagtail.blocks
  9. import wagtail.fields
  10. import wagtail.embeds.blocks
  11. import wagtail.images.blocks
  12. class Migration(migrations.Migration):
  13. initial = True
  14. dependencies = [
  15. ("taggit", "0002_auto_20150616_2121"),
  16. ("wagtailcore", "0032_add_bulk_delete_page_permission"),
  17. ("base", "0001_initial"),
  18. ("wagtailimages", "0018_remove_rendition_filter"),
  19. ]
  20. operations = [
  21. migrations.CreateModel(
  22. name="BlogIndexPage",
  23. fields=[
  24. (
  25. "page_ptr",
  26. models.OneToOneField(
  27. auto_created=True,
  28. on_delete=django.db.models.deletion.CASCADE,
  29. parent_link=True,
  30. primary_key=True,
  31. serialize=False,
  32. to="wagtailcore.Page",
  33. ),
  34. ),
  35. (
  36. "introduction",
  37. models.TextField(blank=True, help_text="Text to describe the page"),
  38. ),
  39. (
  40. "body",
  41. wagtail.fields.StreamField(
  42. (
  43. (
  44. "heading_block",
  45. wagtail.blocks.StructBlock(
  46. (
  47. (
  48. "heading_text",
  49. wagtail.blocks.CharBlock(
  50. classname="title", required=True
  51. ),
  52. ),
  53. (
  54. "size",
  55. wagtail.blocks.ChoiceBlock(
  56. blank=True,
  57. choices=[
  58. ("", "Select a header size"),
  59. ("h2", "H2"),
  60. ("h3", "H3"),
  61. ("h4", "H4"),
  62. ],
  63. required=False,
  64. ),
  65. ),
  66. )
  67. ),
  68. ),
  69. (
  70. "paragraph_block",
  71. wagtail.blocks.RichTextBlock(
  72. icon="pilcrow",
  73. template="blocks/paragraph_block.html",
  74. ),
  75. ),
  76. (
  77. "image_block",
  78. wagtail.blocks.StructBlock(
  79. (
  80. (
  81. "image",
  82. wagtail.images.blocks.ImageChooserBlock(
  83. required=True
  84. ),
  85. ),
  86. (
  87. "caption",
  88. wagtail.blocks.CharBlock(required=False),
  89. ),
  90. (
  91. "attribution",
  92. wagtail.blocks.CharBlock(required=False),
  93. ),
  94. )
  95. ),
  96. ),
  97. (
  98. "block_quote",
  99. wagtail.blocks.StructBlock(
  100. (
  101. ("text", wagtail.blocks.TextBlock()),
  102. (
  103. "attribute_name",
  104. wagtail.blocks.CharBlock(
  105. blank=True,
  106. label="e.g. Guy Picciotto",
  107. required=False,
  108. ),
  109. ),
  110. )
  111. ),
  112. ),
  113. (
  114. "embed_block",
  115. wagtail.embeds.blocks.EmbedBlock(
  116. help_text="Insert an embed URL e.g https://www.youtube.com/watch?v=SGJFWirQ3ks",
  117. icon="media",
  118. template="blocks/embed_block.html",
  119. ),
  120. ),
  121. ),
  122. blank=True,
  123. verbose_name="Page body",
  124. ),
  125. ),
  126. (
  127. "image",
  128. models.ForeignKey(
  129. blank=True,
  130. help_text="Landscape mode only; horizontal width between 1000px and 3000px.",
  131. null=True,
  132. on_delete=django.db.models.deletion.SET_NULL,
  133. related_name="+",
  134. to="wagtailimages.Image",
  135. ),
  136. ),
  137. ],
  138. options={
  139. "abstract": False,
  140. },
  141. bases=(
  142. wagtail.contrib.routable_page.models.RoutablePageMixin,
  143. "wagtailcore.page",
  144. models.Model,
  145. ),
  146. ),
  147. migrations.CreateModel(
  148. name="BlogPage",
  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="pilcrow",
  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/watch?v=SGJFWirQ3ks",
  243. icon="media",
  244. template="blocks/embed_block.html",
  245. ),
  246. ),
  247. ),
  248. blank=True,
  249. verbose_name="Page body",
  250. ),
  251. ),
  252. ("subtitle", models.CharField(blank=True, max_length=255)),
  253. (
  254. "date_published",
  255. models.DateField(
  256. blank=True, null=True, verbose_name="Date article published"
  257. ),
  258. ),
  259. (
  260. "image",
  261. models.ForeignKey(
  262. blank=True,
  263. help_text="Landscape mode only; horizontal width between 1000px and 3000px.",
  264. null=True,
  265. on_delete=django.db.models.deletion.SET_NULL,
  266. related_name="+",
  267. to="wagtailimages.Image",
  268. ),
  269. ),
  270. ],
  271. options={
  272. "abstract": False,
  273. },
  274. bases=("wagtailcore.page", models.Model),
  275. ),
  276. migrations.CreateModel(
  277. name="BlogPageTag",
  278. fields=[
  279. (
  280. "id",
  281. models.AutoField(
  282. auto_created=True,
  283. primary_key=True,
  284. serialize=False,
  285. verbose_name="ID",
  286. ),
  287. ),
  288. (
  289. "content_object",
  290. modelcluster.fields.ParentalKey(
  291. on_delete=django.db.models.deletion.CASCADE,
  292. related_name="tagged_items",
  293. to="blog.BlogPage",
  294. ),
  295. ),
  296. (
  297. "tag",
  298. models.ForeignKey(
  299. on_delete=django.db.models.deletion.CASCADE,
  300. related_name="blog_blogpagetag_items",
  301. to="taggit.Tag",
  302. ),
  303. ),
  304. ],
  305. options={
  306. "abstract": False,
  307. },
  308. ),
  309. migrations.CreateModel(
  310. name="BlogPeopleRelationship",
  311. fields=[
  312. (
  313. "id",
  314. models.AutoField(
  315. auto_created=True,
  316. primary_key=True,
  317. serialize=False,
  318. verbose_name="ID",
  319. ),
  320. ),
  321. (
  322. "sort_order",
  323. models.IntegerField(blank=True, editable=False, null=True),
  324. ),
  325. (
  326. "page",
  327. modelcluster.fields.ParentalKey(
  328. on_delete=django.db.models.deletion.CASCADE,
  329. related_name="blog_person_relationship",
  330. to="blog.BlogPage",
  331. ),
  332. ),
  333. (
  334. "people",
  335. models.ForeignKey(
  336. on_delete=django.db.models.deletion.CASCADE,
  337. related_name="person_blog_relationship",
  338. to="base.People",
  339. ),
  340. ),
  341. ],
  342. options={
  343. "ordering": ["sort_order"],
  344. "abstract": False,
  345. },
  346. ),
  347. migrations.AddField(
  348. model_name="blogpage",
  349. name="tags",
  350. field=modelcluster.contrib.taggit.ClusterTaggableManager(
  351. blank=True,
  352. help_text="A comma-separated list of tags.",
  353. through="blog.BlogPageTag",
  354. to="taggit.Tag",
  355. verbose_name="Tags",
  356. ),
  357. ),
  358. ]