Renamed subscription

This commit is contained in:
Zak Timson 2017-08-18 22:55:17 -04:00
parent 3a96c13ad5
commit fd433ef9f6
2 changed files with 4 additions and 8 deletions

View File

@ -2,15 +2,15 @@ from django.contrib import admin
from django.contrib.auth.admin import User
from django.utils import timezone
from .models import Newsletter, Subscriber
from .models import Newsletter, NewsletterSubscription
class SubscriberInline(admin.StackedInline):
can_delete = False
extra = 1
fields = ['subscribed']
max_num = 1
model = Subscriber
verbose_name = 'Newsletter'
model = NewsletterSubscription
class ExtendUserAdmin(admin.ModelAdmin):
@ -20,7 +20,6 @@ class ExtendUserAdmin(admin.ModelAdmin):
inlines = [SubscriberInline]
def newsletter(self, obj):
print(vars(obj))
return bool(True)
newsletter.boolean = True

View File

@ -14,9 +14,6 @@ class Newsletter(models.Model):
return self.subject
class Subscriber(models.Model):
class NewsletterSubscription(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
subscribed = models.BooleanField(default=False)
def __str__(self):
return ''