From 15bb502dd3147d8ad96cc40f7cbc0e4c2cb68d11 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 11 Dec 2023 16:26:25 -0500 Subject: lttr: added date and postcards sent fields --- app/lttr/admin.py | 2 +- .../0024_postcardsubscriber_postcards_sent.py | 18 ++++++++++++++++++ app/lttr/models.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 app/lttr/migrations/0024_postcardsubscriber_postcards_sent.py (limited to 'app/lttr') diff --git a/app/lttr/admin.py b/app/lttr/admin.py index ad35959..8acce33 100644 --- a/app/lttr/admin.py +++ b/app/lttr/admin.py @@ -99,7 +99,7 @@ class NewsletterMailingAdmin(admin.ModelAdmin): @admin.register(PostcardSubscriber) class PostcardSubscriberAdmin(admin.ModelAdmin): - list_display = ('name', 'address') + list_display = ('name', 'address', 'date_created', 'postcards_sent') class Media: js = ('next-prev-links.js',) diff --git a/app/lttr/migrations/0024_postcardsubscriber_postcards_sent.py b/app/lttr/migrations/0024_postcardsubscriber_postcards_sent.py new file mode 100644 index 0000000..f5e5fe4 --- /dev/null +++ b/app/lttr/migrations/0024_postcardsubscriber_postcards_sent.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.7 on 2023-12-11 16:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('lttr', '0023_alter_newslettermailing_options_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='postcardsubscriber', + name='postcards_sent', + field=models.PositiveIntegerField(default=0), + ), + ] diff --git a/app/lttr/models.py b/app/lttr/models.py index 76a3872..0a9fdc7 100644 --- a/app/lttr/models.py +++ b/app/lttr/models.py @@ -479,6 +479,7 @@ class PostcardSubscriber(models.Model): date_updated = models.DateTimeField(blank=True, auto_now=True, editable=False) address = models.TextField() name = models.CharField(max_length=120) + postcards_sent = models.PositiveIntegerField(default=0) def __str__(self): return self.name -- cgit v1.2.3-70-g09d2