list_display = ['email', 'level', 'since', 'expires_at']
search_fields = ['email']
date_hierarchy = 'since'
- actions = [export_as_csv_action(fields=['id', 'email', 'get_level_display', 'since', 'expires_at'])]
+ actions = [
+ export_as_csv_action(fields=['id', 'email', 'get_level_display', 'since', 'expires_at']),
+ export_as_csv_action('Eksport dla PHPList', fields=['email', 'wl_optout_url'])
+ ]
admin.site.register(models.Contact, ContactAdmin)
self.expires_at = expires_at
self.save()
+ def wl_optout_url(self):
+ return 'https://wolnelektury.pl' + self.get_optout_url()
+
class EmailSent(models.Model):
template = models.ForeignKey(EmailTemplate, models.CASCADE)