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)

    def __str__(self):
        return 'Messagerie_'+self.id