2
0

0001_initial.py 6.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.core.blocks
  10. import wagtail.core.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. ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
  26. ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
  27. ('body', wagtail.core.fields.StreamField((('heading_block', wagtail.core.blocks.StructBlock((('heading_text', wagtail.core.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.core.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.core.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.CharBlock(required=False)), ('attribution', wagtail.core.blocks.CharBlock(required=False))))), ('block_quote', wagtail.core.blocks.StructBlock((('text', wagtail.core.blocks.TextBlock()), ('attribute_name', wagtail.core.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
  28. ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
  29. ],
  30. options={
  31. 'abstract': False,
  32. },
  33. bases=(wagtail.contrib.routable_page.models.RoutablePageMixin, 'wagtailcore.page', models.Model),
  34. ),
  35. migrations.CreateModel(
  36. name='BlogPage',
  37. fields=[
  38. ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
  39. ('introduction', models.TextField(blank=True, help_text='Text to describe the page')),
  40. ('body', wagtail.core.fields.StreamField((('heading_block', wagtail.core.blocks.StructBlock((('heading_text', wagtail.core.blocks.CharBlock(classname='title', required=True)), ('size', wagtail.core.blocks.ChoiceBlock(blank=True, choices=[('', 'Select a header size'), ('h2', 'H2'), ('h3', 'H3'), ('h4', 'H4')], required=False))))), ('paragraph_block', wagtail.core.blocks.RichTextBlock(icon='fa-paragraph', template='blocks/paragraph_block.html')), ('image_block', wagtail.core.blocks.StructBlock((('image', wagtail.images.blocks.ImageChooserBlock(required=True)), ('caption', wagtail.core.blocks.CharBlock(required=False)), ('attribution', wagtail.core.blocks.CharBlock(required=False))))), ('block_quote', wagtail.core.blocks.StructBlock((('text', wagtail.core.blocks.TextBlock()), ('attribute_name', wagtail.core.blocks.CharBlock(blank=True, label='e.g. Guy Picciotto', required=False))))), ('embed_block', wagtail.embeds.blocks.EmbedBlock(help_text='Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks', icon='fa-s15', template='blocks/embed_block.html'))), blank=True, verbose_name='Page body')),
  41. ('subtitle', models.CharField(blank=True, max_length=255)),
  42. ('date_published', models.DateField(blank=True, null=True, verbose_name='Date article published')),
  43. ('image', models.ForeignKey(blank=True, help_text='Landscape mode only; horizontal width between 1000px and 3000px.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
  44. ],
  45. options={
  46. 'abstract': False,
  47. },
  48. bases=('wagtailcore.page', models.Model),
  49. ),
  50. migrations.CreateModel(
  51. name='BlogPageTag',
  52. fields=[
  53. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  54. ('content_object', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_items', to='blog.BlogPage')),
  55. ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='blog_blogpagetag_items', to='taggit.Tag')),
  56. ],
  57. options={
  58. 'abstract': False,
  59. },
  60. ),
  61. migrations.CreateModel(
  62. name='BlogPeopleRelationship',
  63. fields=[
  64. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  65. ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
  66. ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='blog_person_relationship', to='blog.BlogPage')),
  67. ('people', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='person_blog_relationship', to='base.People')),
  68. ],
  69. options={
  70. 'ordering': ['sort_order'],
  71. 'abstract': False,
  72. },
  73. ),
  74. migrations.AddField(
  75. model_name='blogpage',
  76. name='tags',
  77. field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='blog.BlogPageTag', to='taggit.Tag', verbose_name='Tags'),
  78. ),
  79. ]