This commit is contained in:
Maurice Debray 2022-02-05 16:18:00 +01:00
parent bc7430cb5d
commit 5062a1e84e
7 changed files with 42 additions and 25 deletions

View file

@ -6,13 +6,18 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('actu', '0001_initial'),
("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)"),
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)",
),
),
]

View file

@ -6,13 +6,13 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gestion', '0008_auto_20211022_1923'),
("gestion", "0008_auto_20211022_1923"),
]
operations = [
migrations.AddField(
model_name='ernestouser',
name='is_chef_mu',
field=models.BooleanField(default=False, verbose_name='Respo musique'),
model_name="ernestouser",
name="is_chef_mu",
field=models.BooleanField(default=False, verbose_name="Respo musique"),
),
]

View file

@ -46,6 +46,7 @@ class ChefComRequiredMixin(UserPassesTestMixin):
)
return is_chef or is_chef_com
class ChefMuRequiredMixin(UserPassesTestMixin):
def test_func(self):
user = self.request.user
@ -74,8 +75,6 @@ class AllChefRequiredMixin(UserPassesTestMixin):
and user.profile.is_chef_event
)
is_chef_mu = (
(user is not None)
and hasattr(user, "profile")
and user.profile.is_chef_mu
(user is not None) and hasattr(user, "profile") and user.profile.is_chef_mu
)
return is_chef or is_chef_com or is_chef_event or is_su or is_chef_mu

View file

@ -1,10 +1,13 @@
from django.contrib import admin
from .models import Category, PartitionSet, SetList, Partition
from .models import Category, Partition, PartitionSet, SetList
class PartitionAdmin(admin.ModelAdmin):
list_filter = ( 'morceau', )
list_filter = ("morceau",)
admin.site.register(Category)
admin.site.register(PartitionSet)
admin.site.register(SetList)
admin.site.register(Partition,PartitionAdmin)
admin.site.register(Partition, PartitionAdmin)

View file

@ -1,18 +1,22 @@
# Generated by Django 2.2.24 on 2022-01-18 14:25
from django.db import migrations
import django.db.models.functions.text
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('partitions', '0005_setlist'),
("partitions", "0005_setlist"),
]
operations = [
migrations.AlterModelOptions(
name='partition',
options={'ordering': (django.db.models.functions.text.Lower('nom'),), 'verbose_name': 'Partition', 'verbose_name_plural': 'Partitions'},
name="partition",
options={
"ordering": (django.db.models.functions.text.Lower("nom"),),
"verbose_name": "Partition",
"verbose_name_plural": "Partitions",
},
),
]

View file

@ -1,18 +1,22 @@
# Generated by Django 2.2.24 on 2022-01-18 14:42
from django.db import migrations
import django.db.models.functions.text
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('partitions', '0006_auto_20220118_1525'),
("partitions", "0006_auto_20220118_1525"),
]
operations = [
migrations.AlterModelOptions(
name='partitionset',
options={'ordering': ('category', django.db.models.functions.text.Lower('nom')), 'verbose_name': 'Morceau', 'verbose_name_plural': 'Morceaux'},
name="partitionset",
options={
"ordering": ("category", django.db.models.functions.text.Lower("nom")),
"verbose_name": "Morceau",
"verbose_name_plural": "Morceaux",
},
),
]

View file

@ -1,10 +1,10 @@
import os
from django.conf import settings
from django.contrib import admin
from django.db import models
from django.db.models.functions import Lower
from django.utils.translation import gettext_lazy as _
from django.contrib import admin
class Category(models.Model):
@ -39,7 +39,6 @@ class Partition(models.Model):
ordering = (Lower("nom"),)
class PartitionSet(models.Model):
nom = models.CharField(max_length=100)
auteur = models.CharField(max_length=100)
@ -71,7 +70,10 @@ class PartitionSet(models.Model):
class Meta:
verbose_name = _("Morceau")
verbose_name_plural = _("Morceaux")
ordering = ("category",Lower("nom"),)
ordering = (
"category",
Lower("nom"),
)
from datetime import date as ddate