forked from DGNum/gestioCOF
Clean code up
This commit is contained in:
parent
3d091f50b5
commit
6d72644ee3
5 changed files with 65 additions and 61 deletions
|
@ -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
|
||||
|
|
|
@ -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 ?'),
|
||||
),
|
||||
]
|
61
gestioncof/cms/migrations/0002_utilpage_and_fixes.py
Normal file
61
gestioncof/cms/migrations/0002_utilpage_and_fixes.py
Normal file
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -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"},
|
||||
),
|
||||
]
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue