oacpl/newsletter/models.py

22 lines
531 B
Python
Raw Normal View History

2017-08-18 21:25:17 -04:00
from django.db import models
from django.contrib.auth.admin import User
from django.utils.timezone import now
class Newsletter(models.Model):
body = models.TextField()
created = models.DateTimeField(auto_now_add=True)
creator = models.ForeignKey(User)
publish = models.DateTimeField(default=now())
subject = models.CharField(max_length=255)
def __str__(self):
return self.subject
2017-08-18 23:23:03 -04:00
class Subscriber(models.Model):
email = models.EmailField()
def __str__(self):
return self.email