Correction de l'ordre des status

Fix #55
This commit is contained in:
Jean-Marie Favreau 2023-12-12 20:11:22 +01:00
parent a5f8b9e870
commit c46c5a96d0
3 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2023-12-12 19:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda_culturel', '0005_delete_eventsubmissionform'),
]
operations = [
migrations.AlterField(
model_name='event',
name='status',
field=models.CharField(choices=[('published', 'Published'), ('draft', 'Draft'), ('trash', 'Trash')], default='published', max_length=20, verbose_name='Status'),
),
]

View File

@ -92,8 +92,8 @@ class Event(models.Model):
class STATUS(models.TextChoices):
PUBLISHED = "published", _("Published")
TRASH = "trash", _("Trash")
DRAFT = "draft", _("Draft")
TRASH = "trash", _("Trash")
created_date = models.DateTimeField(auto_now_add=True)
modified_date = models.DateTimeField(auto_now=True)

View File

@ -316,6 +316,7 @@ def import_from_url(request):
return render(request, 'agenda_culturel/import.html', context={'form': form })
class EventFilterAdmin(django_filters.FilterSet):
status = django_filters.MultipleChoiceFilter(choices=Event.STATUS.choices, widget=forms.CheckboxSelectMultiple)