Ajout du module comm_op

This commit is contained in:
Ambulance Clerc
2023-10-10 18:29:45 +02:00
parent 28042c851a
commit 7d37cfd1df
3 changed files with 56 additions and 5 deletions

View File

@@ -1,14 +1,25 @@
from django.db import models
from django.conf import settings
from django.utils import timezone
# Create your models here.
class cr_Category(models.Model):
sName = models.CharField("Désignation", max_length=250)
class comm_opMessage(models.Model):
sKey = models.CharField("Clé d'identification", max_length=100)
sTitle = models.CharField('Titre', max_length=250)
sDesc = models.TextField('Description')
dtStart = models.DateField("Date de début", default=timezone.now)
dtEnd = models.DateField("Date de fin", blank=True, null=True)
bDone = models.BooleanField("Effectuée", default=False)
sAuthor = models.CharField("Auteur", max_length=120)
Author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name="Auteur", on_delete=models.DO_NOTHING)
dtUpdated = models.DateTimeField('date updated', auto_now=True)
dtCreated = models.DateTimeField('date published', auto_now_add=True)
def __str__(self):
return self.sName
return self.sKey + " -- " + self.sTitle
class Meta:
verbose_name = "catégorie"
verbose_name_plural = "catégories"
verbose_name = "Communication importante"
verbose_name_plural = "Communications importantes"