From d04691c1ec0318b1cb49c83327cb99b11024ef83 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Thu, 23 Feb 2017 09:23:18 +0100 Subject: [PATCH] Reverted migrations --- .../migrations/0003_auto_20161209_0655.py | 33 ---------------- ...221_1728.py => 0003_auto_20170223_0922.py} | 30 ++++++++++----- .../migrations/0005_auto_20170221_1748.py | 38 ------------------- .../migrations/0006_auto_20170221_1811.py | 28 -------------- publichealth/home/models.py | 8 +++- .../{article => home}/article_page.html | 0 6 files changed, 27 insertions(+), 110 deletions(-) delete mode 100644 publichealth/home/migrations/0003_auto_20161209_0655.py rename publichealth/home/migrations/{0004_auto_20170221_1728.py => 0003_auto_20170223_0922.py} (66%) delete mode 100644 publichealth/home/migrations/0005_auto_20170221_1748.py delete mode 100644 publichealth/home/migrations/0006_auto_20170221_1811.py rename publichealth/home/templates/{article => home}/article_page.html (100%) diff --git a/publichealth/home/migrations/0003_auto_20161209_0655.py b/publichealth/home/migrations/0003_auto_20161209_0655.py deleted file mode 100644 index 0a1d370..0000000 --- a/publichealth/home/migrations/0003_auto_20161209_0655.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.4 on 2016-12-09 05:55 -from __future__ import unicode_literals - -from django.db import migrations, models -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields -import wagtail.wagtailimages.blocks - - -class Migration(migrations.Migration): - - dependencies = [ - ('home', '0002_create_homepage'), - ] - - operations = [ - migrations.AddField( - model_name='homepage', - name='body_de', - field=wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True), - ), - migrations.AddField( - model_name='homepage', - name='body_fr', - field=wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True), - ), - migrations.AddField( - model_name='homepage', - name='title_fr', - field=models.CharField(default='', max_length=255), - ), - ] diff --git a/publichealth/home/migrations/0004_auto_20170221_1728.py b/publichealth/home/migrations/0003_auto_20170223_0922.py similarity index 66% rename from publichealth/home/migrations/0004_auto_20170221_1728.py rename to publichealth/home/migrations/0003_auto_20170223_0922.py index 7217474..f1c749e 100644 --- a/publichealth/home/migrations/0004_auto_20170221_1728.py +++ b/publichealth/home/migrations/0003_auto_20170223_0922.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-21 16:28 +# Generated by Django 1.10.5 on 2017-02-23 08:22 from __future__ import unicode_literals from django.db import migrations, models @@ -13,9 +13,9 @@ import wagtail.wagtailimages.blocks class Migration(migrations.Migration): dependencies = [ - ('wagtailimages', '0016_deprecate_rendition_filter_relation'), ('wagtailcore', '0032_add_bulk_delete_page_permission'), - ('home', '0003_auto_20161209_0655'), + ('wagtailimages', '0018_remove_rendition_filter'), + ('home', '0002_create_homepage'), ] operations = [ @@ -36,8 +36,10 @@ class Migration(migrations.Migration): ('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')), ('title_fr', models.CharField(default='', max_length=255)), ('date', models.DateField(verbose_name='Date')), - ('body_de', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True)), - ('body_fr', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())), blank=True, null=True)), + ('intro_de', wagtail.wagtailcore.fields.RichTextField(default='')), + ('intro_fr', wagtail.wagtailcore.fields.RichTextField(default='')), + ('body_de', wagtail.wagtailcore.fields.StreamField([('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())], blank=True, null=True)), + ('body_fr', wagtail.wagtailcore.fields.StreamField([('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock())], blank=True, null=True)), ('feed_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), ], options={ @@ -55,21 +57,29 @@ class Migration(migrations.Migration): ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_links', to='home.ArticlePage')), ], options={ - 'abstract': False, 'ordering': ['sort_order'], + 'abstract': False, }, ), - migrations.RemoveField( + migrations.AddField( model_name='homepage', name='body_de', + field=wagtail.wagtailcore.fields.RichTextField(default=''), ), - migrations.RemoveField( + migrations.AddField( model_name='homepage', name='body_fr', + field=wagtail.wagtailcore.fields.RichTextField(default=''), ), - migrations.RemoveField( + migrations.AddField( model_name='homepage', - name='title_fr', + name='infos_de', + field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock()), (b'action', wagtail.wagtailcore.blocks.CharBlock(required=True))]))], blank=True, null=True), + ), + migrations.AddField( + model_name='homepage', + name='infos_fr', + field=wagtail.wagtailcore.fields.StreamField([('info', wagtail.wagtailcore.blocks.StructBlock([(b'title', wagtail.wagtailcore.blocks.CharBlock(required=True)), (b'photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), (b'summary', wagtail.wagtailcore.blocks.RichTextBlock()), (b'action', wagtail.wagtailcore.blocks.CharBlock(required=True))]))], blank=True, null=True), ), migrations.AddField( model_name='homepage', diff --git a/publichealth/home/migrations/0005_auto_20170221_1748.py b/publichealth/home/migrations/0005_auto_20170221_1748.py deleted file mode 100644 index 7ea7e18..0000000 --- a/publichealth/home/migrations/0005_auto_20170221_1748.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-21 16:48 -from __future__ import unicode_literals - -from django.db import migrations -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields -import wagtail.wagtailimages.blocks - - -class Migration(migrations.Migration): - - dependencies = [ - ('home', '0004_auto_20170221_1728'), - ] - - operations = [ - migrations.AddField( - model_name='homepage', - name='body_de', - field=wagtail.wagtailcore.fields.RichTextField(default=''), - ), - migrations.AddField( - model_name='homepage', - name='body_fr', - field=wagtail.wagtailcore.fields.RichTextField(default=''), - ), - migrations.AddField( - model_name='homepage', - name='infos_de', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock())))),), blank=True, null=True), - ), - migrations.AddField( - model_name='homepage', - name='infos_fr', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock())))),), blank=True, null=True), - ), - ] diff --git a/publichealth/home/migrations/0006_auto_20170221_1811.py b/publichealth/home/migrations/0006_auto_20170221_1811.py deleted file mode 100644 index a99f1a3..0000000 --- a/publichealth/home/migrations/0006_auto_20170221_1811.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.10.5 on 2017-02-21 17:11 -from __future__ import unicode_literals - -from django.db import migrations -import wagtail.wagtailcore.blocks -import wagtail.wagtailcore.fields -import wagtail.wagtailimages.blocks - - -class Migration(migrations.Migration): - - dependencies = [ - ('home', '0005_auto_20170221_1748'), - ] - - operations = [ - migrations.AlterField( - model_name='homepage', - name='infos_de', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock()), ('action', wagtail.wagtailcore.blocks.CharBlock(required=True))))),), blank=True, null=True), - ), - migrations.AlterField( - model_name='homepage', - name='infos_fr', - field=wagtail.wagtailcore.fields.StreamField((('info', wagtail.wagtailcore.blocks.StructBlock((('title', wagtail.wagtailcore.blocks.CharBlock(required=True)), ('photo', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('summary', wagtail.wagtailcore.blocks.RichTextBlock()), ('action', wagtail.wagtailcore.blocks.CharBlock(required=True))))),), blank=True, null=True), - ), - ] diff --git a/publichealth/home/models.py b/publichealth/home/models.py index 2fe63b2..8370518 100644 --- a/publichealth/home/models.py +++ b/publichealth/home/models.py @@ -36,6 +36,13 @@ class ArticlePage(Page): ) date = models.DateField("Date") + + intro_de = RichTextField(default='') + intro_fr = RichTextField(default='') + intro = TranslatedField( + 'intro_de', + 'intro_fr', + ) body_de = StreamField([ ('heading', blocks.CharBlock(classname="full title")), @@ -80,7 +87,6 @@ class ArticlePage(Page): ] parent_page_types = ['home.ArticleIndexPage'] subpage_types = [] - template = 'article/article_page.html' class ArticleRelatedLink(Orderable): page = ParentalKey(ArticlePage, related_name='related_links') diff --git a/publichealth/home/templates/article/article_page.html b/publichealth/home/templates/home/article_page.html similarity index 100% rename from publichealth/home/templates/article/article_page.html rename to publichealth/home/templates/home/article_page.html