ernestophone.ens.fr/actu/models.py

27 lines
777 B
Python
Raw Permalink Normal View History

from django.db import models
from django.utils.translation import gettext_lazy as _
2021-04-29 00:27:33 +02:00
class Actu(models.Model):
2021-04-29 00:27:33 +02:00
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"))
2022-01-06 13:11:16 +01:00
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,
)
2021-04-29 00:27:33 +02:00
def __str__(self):
return self.text
class Meta:
verbose_name = _("Actualité")
verbose_name_plural = _("Actualités")
2021-04-29 00:27:33 +02:00
ordering = ("order",)