Modification du modèle et des vues

This commit is contained in:
Maurice Debray 2021-12-23 22:56:51 +01:00
parent 149cc3b9f0
commit e6f9173c62
2 changed files with 3 additions and 2 deletions

View file

@ -7,6 +7,7 @@ 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.BooleanField(_("Actu en arc-en-ciel"), default=False)
def __str__(self):
return self.text

View file

@ -14,7 +14,7 @@ class ActuList(ChefRequiredMixin, ListView):
class ActuCreate(ChefRequiredMixin, CreateView):
model = Actu
fields = ["text", "order", "text_en"]
fields = ["text", "order", "text_en", "rainbow"]
template_name = "actu/create_actu.html"
success_url = reverse_lazy("actu:liste")
@ -26,7 +26,7 @@ class ActuCreate(ChefRequiredMixin, CreateView):
class ActuUpdate(ChefRequiredMixin, UpdateView):
model = Actu
fields = ["text", "order", "text_en"]
fields = ["text", "order", "text_en", "rainbow"]
template_name = "actu/update_actu.html"
success_url = reverse_lazy("actu:liste")