You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

abstract_models.py 565B

1234567891011121314151617
  1. from django.db import models
  2. from django.utils.translation import ugettext_lazy as _
  3. class AbstractEmail(models.Model):
  4. user = models.ForeignKey('auth.User', related_name='emails')
  5. subject = models.TextField(_('Subject'), max_length=255)
  6. body_text = models.TextField()
  7. body_html = models.TextField(blank=True, null=True)
  8. date_sent = models.DateTimeField(auto_now_add=True)
  9. class Meta:
  10. abstract = True
  11. def __unicode__(self):
  12. return u"Email to %s with subject '%s'" % (self.user.username, self.subject)