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