Black + isort

This commit is contained in:
Ludovic Stephan 2019-02-09 14:37:15 +01:00
parent 0f1e05acdd
commit 1c45dd833d
4 changed files with 430 additions and 79 deletions

View file

@ -2,13 +2,14 @@
# Generated by Django 1.11.18 on 2019-02-04 20:45
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import gestioncof.cms.models
import wagtail.contrib.routable_page.models
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations, models
import gestioncof.cms.models
class Migration(migrations.Migration):
@ -16,103 +17,457 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailimages', '0021_image_file_hash'),
('wagtailcore', '0040_page_draft_title'),
("wagtailimages", "0021_image_file_hash"),
("wagtailcore", "0040_page_draft_title"),
]
operations = [
migrations.CreateModel(
name='COFActuIndexPage',
name="COFActuIndexPage",
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')),
(
"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': 'Index des actualités',
'verbose_name_plural': 'Indexs des actualités',
"verbose_name": "Index des actualités",
"verbose_name_plural": "Indexs des actualités",
},
bases=('wagtailcore.page', gestioncof.cms.models.COFActuIndexMixin),
bases=("wagtailcore.page", gestioncof.cms.models.COFActuIndexMixin),
),
migrations.CreateModel(
name='COFActuPage',
name="COFActuPage",
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')),
('chapo', models.TextField(blank=True, verbose_name='Description rapide')),
('chapo_fr', models.TextField(blank=True, null=True, verbose_name='Description rapide')),
('chapo_en', models.TextField(blank=True, null=True, verbose_name='Description rapide')),
('body', wagtail.core.fields.RichTextField(verbose_name='Contenu')),
('body_fr', wagtail.core.fields.RichTextField(null=True, verbose_name='Contenu')),
('body_en', wagtail.core.fields.RichTextField(null=True, verbose_name='Contenu')),
('is_event', models.BooleanField(default=True, verbose_name='Évènement')),
('date_start', models.DateTimeField(verbose_name='Date et heure de début')),
('date_end', models.DateTimeField(blank=True, default=None, null=True, verbose_name='Date et heure de fin')),
('all_day', models.BooleanField(default=False, verbose_name='Toute la journée')),
('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image', verbose_name='Image à la Une')),
(
"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",
),
),
(
"chapo",
models.TextField(blank=True, verbose_name="Description rapide"),
),
(
"chapo_fr",
models.TextField(
blank=True, null=True, verbose_name="Description rapide"
),
),
(
"chapo_en",
models.TextField(
blank=True, null=True, verbose_name="Description rapide"
),
),
("body", wagtail.core.fields.RichTextField(verbose_name="Contenu")),
(
"body_fr",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Contenu"
),
),
(
"body_en",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Contenu"
),
),
(
"is_event",
models.BooleanField(default=True, verbose_name="Évènement"),
),
(
"date_start",
models.DateTimeField(verbose_name="Date et heure de début"),
),
(
"date_end",
models.DateTimeField(
blank=True,
default=None,
null=True,
verbose_name="Date et heure de fin",
),
),
(
"all_day",
models.BooleanField(default=False, verbose_name="Toute la journée"),
),
(
"image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.Image",
verbose_name="Image à la Une",
),
),
],
options={
'verbose_name': 'Actualité',
'verbose_name_plural': 'Actualités',
},
bases=(wagtail.contrib.routable_page.models.RoutablePageMixin, 'wagtailcore.page'),
options={"verbose_name": "Actualité", "verbose_name_plural": "Actualités"},
bases=(
wagtail.contrib.routable_page.models.RoutablePageMixin,
"wagtailcore.page",
),
),
migrations.CreateModel(
name='COFDirectoryEntryPage',
name="COFDirectoryEntryPage",
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')),
('body', wagtail.core.fields.RichTextField(verbose_name='Description')),
('body_fr', wagtail.core.fields.RichTextField(null=True, verbose_name='Description')),
('body_en', wagtail.core.fields.RichTextField(null=True, verbose_name='Description')),
('links', wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())]))])),
('links_fr', wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())]))], null=True)),
('links_en', wagtail.core.fields.StreamField([('lien', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())])), ('contact', wagtail.core.blocks.StructBlock([('email', wagtail.core.blocks.EmailBlock(required=True)), ('texte', wagtail.core.blocks.CharBlock())]))], null=True)),
('image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image', verbose_name='Image')),
(
"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",
),
),
("body", wagtail.core.fields.RichTextField(verbose_name="Description")),
(
"body_fr",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Description"
),
),
(
"body_en",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Description"
),
),
(
"links",
wagtail.core.fields.StreamField(
[
(
"lien",
wagtail.core.blocks.StructBlock(
[
(
"url",
wagtail.core.blocks.URLBlock(required=True),
),
("texte", wagtail.core.blocks.CharBlock()),
]
),
),
(
"contact",
wagtail.core.blocks.StructBlock(
[
(
"email",
wagtail.core.blocks.EmailBlock(
required=True
),
),
("texte", wagtail.core.blocks.CharBlock()),
]
),
),
]
),
),
(
"links_fr",
wagtail.core.fields.StreamField(
[
(
"lien",
wagtail.core.blocks.StructBlock(
[
(
"url",
wagtail.core.blocks.URLBlock(required=True),
),
("texte", wagtail.core.blocks.CharBlock()),
]
),
),
(
"contact",
wagtail.core.blocks.StructBlock(
[
(
"email",
wagtail.core.blocks.EmailBlock(
required=True
),
),
("texte", wagtail.core.blocks.CharBlock()),
]
),
),
],
null=True,
),
),
(
"links_en",
wagtail.core.fields.StreamField(
[
(
"lien",
wagtail.core.blocks.StructBlock(
[
(
"url",
wagtail.core.blocks.URLBlock(required=True),
),
("texte", wagtail.core.blocks.CharBlock()),
]
),
),
(
"contact",
wagtail.core.blocks.StructBlock(
[
(
"email",
wagtail.core.blocks.EmailBlock(
required=True
),
),
("texte", wagtail.core.blocks.CharBlock()),
]
),
),
],
null=True,
),
),
(
"image",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="+",
to="wagtailimages.Image",
verbose_name="Image",
),
),
],
options={
'verbose_name': "Entrée d'annuaire",
'verbose_name_plural': "Entrées d'annuaire",
"verbose_name": "Entrée d'annuaire",
"verbose_name_plural": "Entrées d'annuaire",
},
bases=('wagtailcore.page',),
bases=("wagtailcore.page",),
),
migrations.CreateModel(
name='COFDirectoryPage',
name="COFDirectoryPage",
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')),
('introduction', wagtail.core.fields.RichTextField(verbose_name='Introduction')),
('introduction_fr', wagtail.core.fields.RichTextField(null=True, verbose_name='Introduction')),
('introduction_en', wagtail.core.fields.RichTextField(null=True, verbose_name='Introduction')),
('alphabetique', models.BooleanField(default=True, verbose_name='Tri par ordre alphabétique ?')),
(
"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",
),
),
(
"introduction",
wagtail.core.fields.RichTextField(verbose_name="Introduction"),
),
(
"introduction_fr",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Introduction"
),
),
(
"introduction_en",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Introduction"
),
),
(
"alphabetique",
models.BooleanField(
default=True, verbose_name="Tri par ordre alphabétique ?"
),
),
],
options={
'verbose_name': 'Annuaire (clubs, partenaires, bons plans...)',
'verbose_name_plural': 'Annuaires',
"verbose_name": "Annuaire (clubs, partenaires, bons plans...)",
"verbose_name_plural": "Annuaires",
},
bases=('wagtailcore.page',),
bases=("wagtailcore.page",),
),
migrations.CreateModel(
name='COFPage',
name="COFPage",
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')),
('body', wagtail.core.fields.StreamField([('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('iframe', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock('Adresse de la page')), ('height', wagtail.core.blocks.CharBlock('Hauteur (en pixels)'))]))])),
('body_fr', wagtail.core.fields.StreamField([('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('iframe', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock('Adresse de la page')), ('height', wagtail.core.blocks.CharBlock('Hauteur (en pixels)'))]))], null=True)),
('body_en', wagtail.core.fields.StreamField([('heading', wagtail.core.blocks.CharBlock(classname='full title')), ('paragraph', wagtail.core.blocks.RichTextBlock()), ('image', wagtail.images.blocks.ImageChooserBlock()), ('iframe', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock('Adresse de la page')), ('height', wagtail.core.blocks.CharBlock('Hauteur (en pixels)'))]))], null=True)),
(
"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",
),
),
(
"body",
wagtail.core.fields.StreamField(
[
(
"heading",
wagtail.core.blocks.CharBlock(classname="full title"),
),
("paragraph", wagtail.core.blocks.RichTextBlock()),
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"iframe",
wagtail.core.blocks.StructBlock(
[
(
"url",
wagtail.core.blocks.URLBlock(
"Adresse de la page"
),
),
(
"height",
wagtail.core.blocks.CharBlock(
"Hauteur (en pixels)"
),
),
]
),
),
]
),
),
(
"body_fr",
wagtail.core.fields.StreamField(
[
(
"heading",
wagtail.core.blocks.CharBlock(classname="full title"),
),
("paragraph", wagtail.core.blocks.RichTextBlock()),
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"iframe",
wagtail.core.blocks.StructBlock(
[
(
"url",
wagtail.core.blocks.URLBlock(
"Adresse de la page"
),
),
(
"height",
wagtail.core.blocks.CharBlock(
"Hauteur (en pixels)"
),
),
]
),
),
],
null=True,
),
),
(
"body_en",
wagtail.core.fields.StreamField(
[
(
"heading",
wagtail.core.blocks.CharBlock(classname="full title"),
),
("paragraph", wagtail.core.blocks.RichTextBlock()),
("image", wagtail.images.blocks.ImageChooserBlock()),
(
"iframe",
wagtail.core.blocks.StructBlock(
[
(
"url",
wagtail.core.blocks.URLBlock(
"Adresse de la page"
),
),
(
"height",
wagtail.core.blocks.CharBlock(
"Hauteur (en pixels)"
),
),
]
),
),
],
null=True,
),
),
],
options={
'verbose_name': 'Page normale COF',
'verbose_name_plural': 'Pages normales COF',
"verbose_name": "Page normale COF",
"verbose_name_plural": "Pages normales COF",
},
bases=('wagtailcore.page',),
bases=("wagtailcore.page",),
),
migrations.CreateModel(
name='COFRootPage',
name="COFRootPage",
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')),
('introduction', wagtail.core.fields.RichTextField(verbose_name='Introduction')),
('introduction_fr', wagtail.core.fields.RichTextField(null=True, verbose_name='Introduction')),
('introduction_en', wagtail.core.fields.RichTextField(null=True, verbose_name='Introduction')),
(
"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",
),
),
(
"introduction",
wagtail.core.fields.RichTextField(verbose_name="Introduction"),
),
(
"introduction_fr",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Introduction"
),
),
(
"introduction_en",
wagtail.core.fields.RichTextField(
null=True, verbose_name="Introduction"
),
),
],
options={
'verbose_name': 'Racine site du COF',
'verbose_name_plural': 'Racines site du COF',
"verbose_name": "Racine site du COF",
"verbose_name_plural": "Racines site du COF",
},
bases=('wagtailcore.page', gestioncof.cms.models.COFActuIndexMixin),
bases=("wagtailcore.page", gestioncof.cms.models.COFActuIndexMixin),
),
]

View file

@ -1,7 +1,7 @@
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.db import models
from wagtail.contrib.routable_page.models import RoutablePageMixin, route
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.contrib.routable_page.models import RoutablePageMixin, route
from wagtail.core import blocks
from wagtail.core.fields import RichTextField, StreamField
from wagtail.core.models import Page

View file

@ -36,7 +36,7 @@ class Migration(migrations.Migration):
"no_header",
models.BooleanField(
verbose_name="Sans en-tête",
help_text="Coché, l'en-tête (avec le titre) de la page n'est pas affiché.",
help_text="Coché, l'en-tête (avec le titre) de la page n'est pas affiché.", # noqa
default=False,
),
),
@ -46,9 +46,7 @@ class Migration(migrations.Migration):
(
(
"rich",
wagtail.core.blocks.RichTextBlock(
label="Éditeur"
),
wagtail.core.blocks.RichTextBlock(label="Éditeur"),
),
("carte", kfet.cms.models.MenuBlock()),
(
@ -58,7 +56,7 @@ class Migration(migrations.Migration):
(
"show_only",
wagtail.core.blocks.IntegerBlock(
help_text="Nombre initial de membres affichés. Laisser vide pour tou-te-s les afficher.",
help_text="Nombre initial de membres affichés. Laisser vide pour tou-te-s les afficher.", # noqa
required=False,
label="Montrer seulement",
),
@ -66,7 +64,7 @@ class Migration(migrations.Migration):
(
"members",
wagtail.core.blocks.ListBlock(
wagtail.snippets.blocks.SnippetChooserBlock(
wagtail.snippets.blocks.SnippetChooserBlock( # noqa
kfet.cms.models.MemberTeam
),
classname="team-group",
@ -93,8 +91,8 @@ class Migration(migrations.Migration):
(
(
"show_only",
wagtail.core.blocks.IntegerBlock(
help_text="Nombre initial de membres affichés. Laisser vide pour tou-te-s les afficher.",
wagtail.core.blocks.IntegerBlock( # noqa
help_text="Nombre initial de membres affichés. Laisser vide pour tou-te-s les afficher.", # noqa
required=False,
label="Montrer seulement",
),
@ -102,8 +100,8 @@ class Migration(migrations.Migration):
(
"members",
wagtail.core.blocks.ListBlock(
wagtail.snippets.blocks.SnippetChooserBlock(
kfet.cms.models.MemberTeam
wagtail.snippets.blocks.SnippetChooserBlock( # noqa
kfet.cms.models.MemberTeam # noqa
),
classname="team-group",
label="K-Fêt-eux-ses",
@ -157,7 +155,7 @@ class Migration(migrations.Migration):
max_length=255,
blank=True,
verbose_name="Nombre de colonnes",
help_text="S'applique au page dont le contenu est scindé sur plusieurs colonnes",
help_text="S'applique au page dont le contenu est scindé sur plusieurs colonnes", # noqa
),
),
],

View file

@ -1,9 +1,7 @@
from modeltranslation.decorators import register
from modeltranslation.translator import TranslationOptions
from .models import (
KFetPage,
)
from .models import KFetPage
@register(KFetPage)