mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
feat: Mise en place du Backend-messagerie [#17]
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.conf import settings
|
||||
from Auth.models import Profile
|
||||
|
||||
|
||||
class Messagerie(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
objet = models.CharField(max_length=200, default="", blank=True)
|
||||
emetteur = models.ForeignKey(Profile, on_delete=models.PROTECT, related_name='messages_envoyes')
|
||||
destinataire = models.ForeignKey(Profile, on_delete=models.PROTECT, related_name='messages_recus')
|
||||
corpus = models.CharField(max_length=200, default="", blank=True)
|
||||
date_envoi = models.DateTimeField(auto_now_add=True) # Date d'envoi du message
|
||||
is_read = models.BooleanField(default=False) # Statut lu/non lu
|
||||
conversation_id = models.CharField(max_length=100, blank=True, default="") # Pour regrouper les messages par conversation
|
||||
|
||||
def __str__(self):
|
||||
return 'Messagerie_'+self.id
|
||||
return f'Messagerie_{self.id}'
|
||||
Reference in New Issue
Block a user