Migrations + black/isort
This commit is contained in:
parent
d217a74da5
commit
b62d6f47a4
16 changed files with 245 additions and 95 deletions
18
actu/migrations/0002_actu_rainbow.py
Normal file
18
actu/migrations/0002_actu_rainbow.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.25 on 2022-01-06 12:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('actu', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='actu',
|
||||
name='rainbow',
|
||||
field=models.CharField(choices=[('y', 'Oui'), ('n', 'Non')], default='n', max_length=1, verbose_name="Actu en arc-en-ciel (ne pas mettre d'émoji, il prennent aussi la couleur et c'est moche)"),
|
||||
),
|
||||
]
|
|
@ -7,7 +7,15 @@ class Actu(models.Model):
|
|||
text = models.TextField(_("Info"), null=True, blank=False)
|
||||
text_en = models.TextField(("Info en anglais"), null=True, blank=True)
|
||||
order = models.IntegerField(verbose_name=_("ordre"))
|
||||
rainbow = models.CharField(verbose_name = _("Actu en arc-en-ciel (ne pas mettre d'émoji, il prennent aussi la couleur et c'est moche)"), max_length=1, choices = (('y', 'Oui'), ('n', 'Non')), default='n', blank = False)
|
||||
rainbow = models.CharField(
|
||||
verbose_name=_(
|
||||
"Actu en arc-en-ciel (ne pas mettre d'émoji, il prennent aussi la couleur et c'est moche)"
|
||||
),
|
||||
max_length=1,
|
||||
choices=(("y", "Oui"), ("n", "Non")),
|
||||
default="n",
|
||||
blank=False,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
|
|
@ -22,11 +22,11 @@ class EventCalendar(HTMLCalendar):
|
|||
for ev in self.events[day]:
|
||||
body.append('<a href="/agenda/' + '%s"' % ev.id)
|
||||
if ev.calendrier == "C":
|
||||
body.append('style="color:#160083">'+esc(ev.nom))
|
||||
body.append('style="color:#160083">' + esc(ev.nom))
|
||||
elif ev.calendrier == "D":
|
||||
body.append('style="color:#770083">'+esc(ev.nom))
|
||||
body.append('style="color:#770083">' + esc(ev.nom))
|
||||
else:
|
||||
body.append('>'+esc(ev.nom))
|
||||
body.append(">" + esc(ev.nom))
|
||||
body.append("</a><br/>")
|
||||
return self.day_cell(
|
||||
cssclass,
|
||||
|
|
|
@ -37,7 +37,13 @@ class EventForm(forms.ModelForm):
|
|||
class ParticipantsForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Participants
|
||||
fields = ("reponse", "details", "dont_play_main", "instrument","instrument_autre")
|
||||
fields = (
|
||||
"reponse",
|
||||
"details",
|
||||
"dont_play_main",
|
||||
"instrument",
|
||||
"instrument_autre",
|
||||
)
|
||||
widgets = {
|
||||
"details": forms.Textarea(attrs={"placeholder": _("50 caractères max")}),
|
||||
}
|
||||
|
|
|
@ -6,23 +6,41 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('calendrier', '0004_auto_20210606_1640'),
|
||||
("calendrier", "0004_auto_20210606_1640"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='calendrier',
|
||||
field=models.CharField(choices=[('F', 'Visible seulement par les fanfarons'), ('T', 'Afficher dans le calendrier pour tous'), ('H', 'Hall of fame'), ('C', 'Visible seulement par les cheff·e·s'), ('D', "Visible seulement par les cheff·e·s et sur l'agenda public")], default='F', max_length=1),
|
||||
model_name="event",
|
||||
name="calendrier",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("F", "Visible seulement par les fanfarons"),
|
||||
("T", "Afficher dans le calendrier pour tous"),
|
||||
("H", "Hall of fame"),
|
||||
("C", "Visible seulement par les cheff·e·s"),
|
||||
("D", "Visible seulement par les cheff·e·s et sur l'agenda public"),
|
||||
],
|
||||
default="F",
|
||||
max_length=1,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='desc_users',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='Infos (visible seulement des fanfaron·ne·s)'),
|
||||
model_name="event",
|
||||
name="desc_users",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="Infos (visible seulement des fanfaron·ne·s)",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='event',
|
||||
name='desc_users_en',
|
||||
field=models.TextField(blank=True, null=True, verbose_name='Infos en anglais (visible seulement des fanfaron·ne·s'),
|
||||
model_name="event",
|
||||
name="desc_users_en",
|
||||
field=models.TextField(
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name="Infos en anglais (visible seulement des fanfaron·ne·s",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -6,18 +6,36 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('calendrier', '0005_auto_20210726_0949'),
|
||||
("calendrier", "0005_auto_20210726_0949"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='participants',
|
||||
name='instrument_autre',
|
||||
model_name="participants",
|
||||
name="instrument_autre",
|
||||
field=models.CharField(blank=True, max_length=50, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='participants',
|
||||
name='instrument',
|
||||
field=models.CharField(blank=True, choices=[('Clarinette', 'Clarinette'), ('Euphonium', 'Euphonium'), ('Percussion', 'Percussion'), ('Piccolo', 'Piccolo'), ('Saxophone Alto', 'Saxophone Alto'), ('Saxophone Ténor', 'Saxophone Ténor'), ('Saxophone Baryton', 'Saxophone Baryton'), ('Souba', 'Souba'), ('Trombone', 'Trombone'), ('Trompette', 'Trompette'), ('Autre', 'Autre'), ('ne sais pas', 'Je ne sais pas encore')], max_length=50, null=True),
|
||||
model_name="participants",
|
||||
name="instrument",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("Clarinette", "Clarinette"),
|
||||
("Euphonium", "Euphonium"),
|
||||
("Percussion", "Percussion"),
|
||||
("Piccolo", "Piccolo"),
|
||||
("Saxophone Alto", "Saxophone Alto"),
|
||||
("Saxophone Ténor", "Saxophone Ténor"),
|
||||
("Saxophone Baryton", "Saxophone Baryton"),
|
||||
("Souba", "Souba"),
|
||||
("Trombone", "Trombone"),
|
||||
("Trompette", "Trompette"),
|
||||
("Autre", "Autre"),
|
||||
("ne sais pas", "Je ne sais pas encore"),
|
||||
],
|
||||
max_length=50,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -3,8 +3,7 @@ import uuid
|
|||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from gestion.models import INSTRU_CHOICES
|
||||
from gestion.models import ErnestoUser
|
||||
from gestion.models import INSTRU_CHOICES, ErnestoUser
|
||||
|
||||
ANSWERS = (
|
||||
("oui", _("Oui")),
|
||||
|
@ -62,7 +61,9 @@ class Participants(models.Model):
|
|||
reponse = models.CharField(
|
||||
_("Réponse"), max_length=20, default="non", choices=ANSWERS
|
||||
)
|
||||
instrument = models.CharField(max_length=50, blank=True, null=True, choices=INSTRU_CHOICES)
|
||||
instrument = models.CharField(
|
||||
max_length=50, blank=True, null=True, choices=INSTRU_CHOICES
|
||||
)
|
||||
instrument_autre = models.CharField(max_length=50, blank=True, null=True)
|
||||
dont_play_main = models.CharField(
|
||||
_("Je veux jouer d'un instrument different de mon instrument principal:"),
|
||||
|
|
|
@ -16,7 +16,7 @@ from calendrier.calend import EventCalendar
|
|||
from calendrier.forms import (ChangeDoodleName, EventForm, ModifEventForm,
|
||||
ParticipantsForm)
|
||||
from calendrier.models import Event, Participants
|
||||
from gestion.mixins import ChefRequiredMixin, ChefEventRequiredMixin
|
||||
from gestion.mixins import ChefEventRequiredMixin, ChefRequiredMixin
|
||||
from gestion.models import Photo
|
||||
|
||||
|
||||
|
@ -76,9 +76,13 @@ class Calendar(LoginRequiredMixin, TemplateView):
|
|||
lMonth = self.pMonth
|
||||
lCalendarFromMonth = datetime(lYear, lMonth, 1)
|
||||
lCalendarToMonth = datetime(lYear, lMonth, monthrange(lYear, lMonth)[1])
|
||||
lEvents = Event.objects.filter(
|
||||
date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth
|
||||
).exclude(calendrier__iexact="C").exclude(calendrier__iexact="D")
|
||||
lEvents = (
|
||||
Event.objects.filter(
|
||||
date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth
|
||||
)
|
||||
.exclude(calendrier__iexact="C")
|
||||
.exclude(calendrier__iexact="D")
|
||||
)
|
||||
lEvents_chef = Event.objects.filter(
|
||||
date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth
|
||||
)
|
||||
|
@ -170,7 +174,6 @@ class Calendar(LoginRequiredMixin, TemplateView):
|
|||
|
||||
|
||||
class Home(Calendar):
|
||||
|
||||
@property
|
||||
def pYear(self):
|
||||
lToday = datetime.now()
|
||||
|
@ -234,25 +237,52 @@ class ViewEvent(LoginRequiredMixin, TemplateView):
|
|||
namesnon += [participant.participant.get_doodlename()]
|
||||
instrument_count[instru] = (sure, maybe, namesoui, namespe, namesnon)
|
||||
instrument_count_l = []
|
||||
instru_order = ["Clarinette","Piccolo","Flute","Glockenspiel","Saxophone Alto","Trompette","Trombone","Cor","Saxophone Ténor","Saxophone Baryton","Clarinette Basse","Euphonium","Souba","Percussion"]
|
||||
instru_order = [
|
||||
"Clarinette",
|
||||
"Piccolo",
|
||||
"Flute",
|
||||
"Glockenspiel",
|
||||
"Saxophone Alto",
|
||||
"Trompette",
|
||||
"Trombone",
|
||||
"Cor",
|
||||
"Saxophone Ténor",
|
||||
"Saxophone Baryton",
|
||||
"Clarinette Basse",
|
||||
"Euphonium",
|
||||
"Souba",
|
||||
"Percussion",
|
||||
]
|
||||
for instrument in instru_order:
|
||||
if instrument in instrument_count.keys():
|
||||
(sure,maybe,namesoui,namespe,namesnon) =instrument_count[instrument]
|
||||
instrument_count_l.append(( instrument, sure,
|
||||
maybe,
|
||||
namesoui,
|
||||
namespe,
|
||||
namesnon,
|
||||
))
|
||||
(sure, maybe, namesoui, namespe, namesnon) = instrument_count[
|
||||
instrument
|
||||
]
|
||||
instrument_count_l.append(
|
||||
(
|
||||
instrument,
|
||||
sure,
|
||||
maybe,
|
||||
namesoui,
|
||||
namespe,
|
||||
namesnon,
|
||||
)
|
||||
)
|
||||
for instrument in sorted(instrument_count.keys()):
|
||||
if instrument not in instru_order:
|
||||
(sure,maybe,namesoui,namespe,namesnon) =instrument_count[instrument]
|
||||
instrument_count_l.append(( instrument, sure,
|
||||
maybe,
|
||||
namesoui,
|
||||
namespe,
|
||||
namesnon,
|
||||
))
|
||||
(sure, maybe, namesoui, namespe, namesnon) = instrument_count[
|
||||
instrument
|
||||
]
|
||||
instrument_count_l.append(
|
||||
(
|
||||
instrument,
|
||||
sure,
|
||||
maybe,
|
||||
namesoui,
|
||||
namespe,
|
||||
namesnon,
|
||||
)
|
||||
)
|
||||
|
||||
context["event"] = event
|
||||
context["instrument_count"] = instrument_count_l
|
||||
|
@ -261,7 +291,7 @@ class ViewEvent(LoginRequiredMixin, TemplateView):
|
|||
context["nbpe"] = len(participants.filter(reponse="pe"))
|
||||
context["nbnon"] = len(participants.filter(reponse="non"))
|
||||
context["multi_instrumentistes"] = multi_instrumentistes
|
||||
context["chef_only"] = (event.calendrier == "C")|(event.calendrier == "D")
|
||||
context["chef_only"] = (event.calendrier == "C") | (event.calendrier == "D")
|
||||
return context
|
||||
|
||||
|
||||
|
@ -337,7 +367,9 @@ class ReponseEvent(LoginRequiredMixin, TemplateView):
|
|||
context["form"] = self.form_class()
|
||||
context["ev"] = get_object_or_404(Event, id=self.kwargs["id"])
|
||||
context["id"] = self.kwargs["id"]
|
||||
context["chef_only"] = (context["ev"].calendrier == "C")|(context["ev"].calendrier == "D")
|
||||
context["chef_only"] = (context["ev"].calendrier == "C") | (
|
||||
context["ev"].calendrier == "D"
|
||||
)
|
||||
return context
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
# Generated by Django 2.2.17 on 2021-06-08 10:29
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
import gestion.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gestion', '0005_auto_20210427_1834'),
|
||||
("gestion", "0005_auto_20210427_1834"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='photo',
|
||||
name='image',
|
||||
field=models.ImageField(default=None, upload_to='trombonoscope/deco', validators=[gestion.models.Photo.validate_image]),
|
||||
model_name="photo",
|
||||
name="image",
|
||||
field=models.ImageField(
|
||||
default=None,
|
||||
upload_to="trombonoscope/deco",
|
||||
validators=[gestion.models.Photo.validate_image],
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -6,13 +6,15 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gestion', '0006_auto_20210608_1029'),
|
||||
("gestion", "0006_auto_20210608_1029"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='ernestouser',
|
||||
name='is_chef_event',
|
||||
field=models.BooleanField(default=False, verbose_name='Respo événement Fanfare'),
|
||||
model_name="ernestouser",
|
||||
name="is_chef_event",
|
||||
field=models.BooleanField(
|
||||
default=False, verbose_name="Respo événement Fanfare"
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -6,23 +6,23 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('gestion', '0007_ernestouser_is_chef_event'),
|
||||
("gestion", "0007_ernestouser_is_chef_event"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='ernestouser',
|
||||
name='is_chef_com',
|
||||
field=models.BooleanField(default=False, verbose_name='Respo com'),
|
||||
model_name="ernestouser",
|
||||
name="is_chef_com",
|
||||
field=models.BooleanField(default=False, verbose_name="Respo com"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='ernestouser',
|
||||
name='is_chef_instru',
|
||||
field=models.BooleanField(default=False, verbose_name='Respo instruments'),
|
||||
model_name="ernestouser",
|
||||
name="is_chef_instru",
|
||||
field=models.BooleanField(default=False, verbose_name="Respo instruments"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='ernestouser',
|
||||
name='is_chef_event',
|
||||
field=models.BooleanField(default=False, verbose_name='Respo événements'),
|
||||
model_name="ernestouser",
|
||||
name="is_chef_event",
|
||||
field=models.BooleanField(default=False, verbose_name="Respo événements"),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -6,32 +6,60 @@ class ChefRequiredMixin(UserPassesTestMixin):
|
|||
user = self.request.user
|
||||
return (user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
|
||||
|
||||
class ChefEventRequiredMixin(UserPassesTestMixin):
|
||||
def test_func(self):
|
||||
user = self.request.user
|
||||
is_chef = (user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
is_chef_event = (user is not None) and hasattr(user, "profile") and user.profile.is_chef_event
|
||||
is_chef = (
|
||||
(user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
)
|
||||
is_chef_event = (
|
||||
(user is not None)
|
||||
and hasattr(user, "profile")
|
||||
and user.profile.is_chef_event
|
||||
)
|
||||
return is_chef or is_chef_event
|
||||
|
||||
|
||||
class ChefInstruRequiredMixin(UserPassesTestMixin):
|
||||
def test_func(self):
|
||||
user = self.request.user
|
||||
is_chef = (user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
is_chef_instru = (user is not None) and hasattr(user, "profile") and user.profile.is_chef_instru
|
||||
is_chef = (
|
||||
(user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
)
|
||||
is_chef_instru = (
|
||||
(user is not None)
|
||||
and hasattr(user, "profile")
|
||||
and user.profile.is_chef_instru
|
||||
)
|
||||
return is_chef or is_chef_instru
|
||||
|
||||
|
||||
class ChefComRequiredMixin(UserPassesTestMixin):
|
||||
def test_func(self):
|
||||
user = self.request.user
|
||||
is_chef = (user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
is_chef_com = (user is not None) and hasattr(user, "profile") and user.profile.is_chef_com
|
||||
is_chef = (
|
||||
(user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
)
|
||||
is_chef_com = (
|
||||
(user is not None) and hasattr(user, "profile") and user.profile.is_chef_com
|
||||
)
|
||||
return is_chef or is_chef_com
|
||||
|
||||
|
||||
class AllChefRequiredMixin(UserPassesTestMixin):
|
||||
def test_func(self):
|
||||
user = self.request.user
|
||||
is_chef = (user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
is_chef = (
|
||||
(user is not None) and hasattr(user, "profile") and user.profile.is_chef
|
||||
)
|
||||
is_su = (user is not None) and user.is_superuser
|
||||
is_chef_com = (user is not None) and hasattr(user, "profile") and user.profile.is_chef_com
|
||||
is_chef_event = (user is not None) and hasattr(user, "profile") and user.profile.is_chef_event
|
||||
return is_chef or is_chef_com or is_chef_event or is_su
|
||||
is_chef_com = (
|
||||
(user is not None) and hasattr(user, "profile") and user.profile.is_chef_com
|
||||
)
|
||||
is_chef_event = (
|
||||
(user is not None)
|
||||
and hasattr(user, "profile")
|
||||
and user.profile.is_chef_event
|
||||
)
|
||||
return is_chef or is_chef_com or is_chef_event or is_su
|
||||
|
|
|
@ -1,27 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
from colorful.fields import RGBColorField
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
import os
|
||||
from django.conf import settings
|
||||
|
||||
INSTRU_CHOICES = [
|
||||
("Clarinette", _("Clarinette")),
|
||||
("Euphonium", _("Euphonium")),
|
||||
("Percussion", _("Percussion")),
|
||||
("Piccolo", _("Piccolo")),
|
||||
("Saxophone Alto", _("Saxophone Alto")),
|
||||
("Saxophone Ténor", _("Saxophone Ténor")),
|
||||
("Saxophone Baryton", _("Saxophone Baryton")),
|
||||
("Souba", _("Souba")),
|
||||
("Trombone", _("Trombone")),
|
||||
("Trompette", _("Trompette")),
|
||||
("Autre", _("Autre")),
|
||||
("ne sais pas", _("Je ne sais pas encore")),
|
||||
]
|
||||
("Clarinette", _("Clarinette")),
|
||||
("Euphonium", _("Euphonium")),
|
||||
("Percussion", _("Percussion")),
|
||||
("Piccolo", _("Piccolo")),
|
||||
("Saxophone Alto", _("Saxophone Alto")),
|
||||
("Saxophone Ténor", _("Saxophone Ténor")),
|
||||
("Saxophone Baryton", _("Saxophone Baryton")),
|
||||
("Souba", _("Souba")),
|
||||
("Trombone", _("Trombone")),
|
||||
("Trompette", _("Trompette")),
|
||||
("Autre", _("Autre")),
|
||||
("ne sais pas", _("Je ne sais pas encore")),
|
||||
]
|
||||
|
||||
|
||||
class Photo(models.Model):
|
||||
PHOTO_PLACEMENT = (
|
||||
("home_join", _("Rejoignez nous")),
|
||||
|
@ -91,7 +94,6 @@ class ErnestoUser(models.Model):
|
|||
help_text=_("seulement visible par les chef·fe·s"),
|
||||
)
|
||||
|
||||
|
||||
COLORS_CHOICES = [
|
||||
("#e4522f#ffffff", _("Orange et Blanc")),
|
||||
("#ffffff#000000", _("Blanc et Noir")),
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import random
|
||||
import string
|
||||
|
||||
|
@ -11,12 +12,12 @@ from django.urls import reverse_lazy
|
|||
from django.utils.translation import gettext_lazy as _
|
||||
from django.views.generic import (CreateView, DeleteView, ListView,
|
||||
TemplateView, UpdateView)
|
||||
import os
|
||||
|
||||
from calendrier.forms import ChangeDoodleName
|
||||
from gestion.forms import (ChangeFormUser, ChangeMembreForm,
|
||||
InscriptionMembreForm, RegistrationFormUser)
|
||||
from gestion.mixins import ChefRequiredMixin, AllChefRequiredMixin, ChefComRequiredMixin
|
||||
from gestion.mixins import (AllChefRequiredMixin, ChefComRequiredMixin,
|
||||
ChefRequiredMixin)
|
||||
from gestion.models import ErnestoUser, Photo, VideoGallery
|
||||
from partitions.models import Category
|
||||
|
||||
|
@ -79,6 +80,7 @@ class Profil(LoginRequiredMixin, TemplateView):
|
|||
class Chef(AllChefRequiredMixin, TemplateView):
|
||||
template_name = "gestion/chef.html"
|
||||
|
||||
|
||||
class YearBook2021(TemplateView):
|
||||
template_name = "gestion/yearbook2021.html"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from django.utils.safestring import mark_safe
|
|||
from django.views.generic import (CreateView, DeleteView, TemplateView,
|
||||
UpdateView)
|
||||
|
||||
from gestion.mixins import ChefRequiredMixin, ChefInstruRequiredMixin
|
||||
from gestion.mixins import ChefInstruRequiredMixin, ChefRequiredMixin
|
||||
from gestion.models import Photo
|
||||
from instruments.forms import ChefEditInstrumentForm, ChefReparationForm
|
||||
from instruments.models import Instrument, Reparation
|
||||
|
@ -28,7 +28,17 @@ class ListeInstru(LoginRequiredMixin, TemplateView):
|
|||
|
||||
class CreateInstru(ChefInstruRequiredMixin, CreateView):
|
||||
model = Instrument
|
||||
fields = ["owner","user", "etat", "type", "marque", "model", "serial", "annee", "prix"]
|
||||
fields = [
|
||||
"owner",
|
||||
"user",
|
||||
"etat",
|
||||
"type",
|
||||
"marque",
|
||||
"model",
|
||||
"serial",
|
||||
"annee",
|
||||
"prix",
|
||||
]
|
||||
template_name = "instruments/create_instru.html"
|
||||
success_url = reverse_lazy("instruments:liste")
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from django.urls import reverse_lazy
|
|||
from django.utils import timezone
|
||||
from django.views.generic import CreateView, DeleteView, ListView, UpdateView
|
||||
|
||||
from gestion.mixins import ChefRequiredMixin, ChefEventRequiredMixin
|
||||
from gestion.mixins import ChefEventRequiredMixin, ChefRequiredMixin
|
||||
from pads.models import Pad
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue