website/conservancy/contacts/models.py
2024-12-11 10:37:02 +11:00

17 lines
446 B
Python

from django.db import models
class Unsubscription(models.Model):
created = models.DateTimeField(auto_now_add=True, blank=True)
email = models.EmailField()
mailout = models.SlugField()
actioned = models.DateField(null=True, blank=True)
class Meta:
ordering = ['created']
def __str__(self):
if self.mailout:
return f'{self.email} ({self.mailout})'
else:
return self.email