website/conservancy/contacts/models.py

18 lines
446 B
Python
Raw Normal View History

from django.db import models
2023-10-19 22:52:39 +00:00
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