diff --git a/cof/settings/common.py b/cof/settings/common.py index 1bd6dcd8..c5143544 100644 --- a/cof/settings/common.py +++ b/cof/settings/common.py @@ -171,8 +171,8 @@ USE_L10N = True USE_TZ = True LANGUAGES = ( - ('fr', u'Français'), - ('en', u'English'), + ('fr', 'Français'), + ('en', 'English'), ) # Various additional settings diff --git a/gestioncof/cms/migrations/0002_auto_20180128_1717.py b/gestioncof/cms/migrations/0002_auto_20180128_1717.py deleted file mode 100644 index 9b32ab15..00000000 --- a/gestioncof/cms/migrations/0002_auto_20180128_1717.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.9 on 2018-01-28 16:17 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cofcms', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='cofdirectoryentrypage', - name='sort_order', - field=models.IntegerField(blank=True, editable=False, null=True), - ), - migrations.AddField( - model_name='cofdirectorypage', - name='alphabetique', - field=models.BooleanField(default=True, verbose_name='Tri par ordre alphabétique ?'), - ), - ] diff --git a/gestioncof/cms/migrations/0002_utilpage_and_fixes.py b/gestioncof/cms/migrations/0002_utilpage_and_fixes.py new file mode 100644 index 00000000..e7a9f7e1 --- /dev/null +++ b/gestioncof/cms/migrations/0002_utilpage_and_fixes.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.9 on 2018-04-28 13:46 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import wagtail.contrib.wagtailroutablepage.models +import wagtail.wagtailcore.blocks +import wagtail.wagtailcore.fields +import wagtail.wagtailimages.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0039_collectionviewrestriction'), + ('cofcms', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='COFUtilPage', + fields=[ + ('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')), + ], + options={ + 'verbose_name': 'Page utilitaire', + 'verbose_name_plural': 'Pages utilitaires', + }, + bases=(wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin, 'wagtailcore.page'), + ), + migrations.AlterModelOptions( + name='cofdirectoryentrypage', + options={'verbose_name': "Entrée d'annuaire", 'verbose_name_plural': "Entrées d'annuaire"}, + ), + migrations.AddField( + model_name='cofdirectoryentrypage', + name='sort_order', + field=models.IntegerField(blank=True, editable=False, null=True), + ), + migrations.AddField( + model_name='cofdirectorypage', + name='alphabetique', + field=models.BooleanField(default=True, verbose_name='Tri par ordre alphabétique ?'), + ), + migrations.AlterField( + model_name='cofpage', + name='body', + field=wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('iframe', wagtail.wagtailcore.blocks.StructBlock((('url', wagtail.wagtailcore.blocks.URLBlock('Adresse de la page')), ('height', wagtail.wagtailcore.blocks.CharBlock('Hauteur (en pixels)'))))))), + ), + migrations.AlterField( + model_name='cofpage', + name='body_en', + field=wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('iframe', wagtail.wagtailcore.blocks.StructBlock((('url', wagtail.wagtailcore.blocks.URLBlock('Adresse de la page')), ('height', wagtail.wagtailcore.blocks.CharBlock('Hauteur (en pixels)')))))), null=True), + ), + migrations.AlterField( + model_name='cofpage', + 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()), ('iframe', wagtail.wagtailcore.blocks.StructBlock((('url', wagtail.wagtailcore.blocks.URLBlock('Adresse de la page')), ('height', wagtail.wagtailcore.blocks.CharBlock('Hauteur (en pixels)')))))), null=True), + ), + ] diff --git a/gestioncof/cms/migrations/0003_auto_20180128_2215.py b/gestioncof/cms/migrations/0003_auto_20180128_2215.py deleted file mode 100644 index 983726b0..00000000 --- a/gestioncof/cms/migrations/0003_auto_20180128_2215.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.9 on 2018-01-28 21:15 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import wagtail.contrib.wagtailroutablepage.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('cofcms', '0002_auto_20180128_1717'), - ] - - operations = [ - migrations.CreateModel( - name='COFUtilPage', - fields=[ - ('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')), - ], - options={ - 'verbose_name_plural': 'Pages utilitaires', - 'verbose_name': 'Page utilitaire', - }, - bases=(wagtail.contrib.wagtailroutablepage.models.RoutablePageMixin, 'wagtailcore.page'), - ), - migrations.AlterModelOptions( - name='cofdirectoryentrypage', - options={'verbose_name': "Entrée d'annuaire", 'verbose_name_plural': "Entrées d'annuaire"}, - ), - ] diff --git a/gestioncof/cms/models.py b/gestioncof/cms/models.py index a66a6bc2..e73e4958 100644 --- a/gestioncof/cms/models.py +++ b/gestioncof/cms/models.py @@ -14,7 +14,7 @@ from wagtail.wagtailimages.blocks import ImageChooserBlock from wagtail.wagtailsnippets.models import register_snippet # Page pouvant afficher des actualités -class COFActuIndexMixin(): +class COFActuIndexMixin: @property def actus(self): actus = COFActuPage.objects.live().order_by('-date_start').descendant_of(self) @@ -74,7 +74,7 @@ class COFActuIndexPage(Page, COFActuIndexMixin): verbose_name_plural = "Indexs des actualités" def get_context(self, request): - context = super(COFActuIndexPage, self).get_context(request) + context = super().get_context(request) actus = COFActuPage.objects.live().descendant_of(self).order_by('-date_end') page = request.GET.get('page')