26 lines
777 B
Python
26 lines
777 B
Python
from django.db import models
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
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,
|
|
)
|
|
|
|
def __str__(self):
|
|
return self.text
|
|
|
|
class Meta:
|
|
verbose_name = _("Actualité")
|
|
verbose_name_plural = _("Actualités")
|
|
ordering = ("order",)
|