summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-12-11 16:26:25 -0500
committerluxagraf <sng@luxagraf.net>2023-12-11 16:26:25 -0500
commit15bb502dd3147d8ad96cc40f7cbc0e4c2cb68d11 (patch)
tree87f6b60ceb21e2f4e03ceefef94e22f5568f90b4
parent800008d24cecec37594b089936af2f9b2a03aecc (diff)
lttr: added date and postcards sent fields
-rw-r--r--app/lttr/admin.py2
-rw-r--r--app/lttr/migrations/0024_postcardsubscriber_postcards_sent.py18
-rw-r--r--app/lttr/models.py1
3 files changed, 20 insertions, 1 deletions
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