1 # -*- coding: utf-8 -*-
4 from django.db.models import Model, EmailField, DateTimeField, BooleanField
5 from django.utils.translation import ugettext_lazy as _
6 from django.conf import settings
9 class Subscription(Model):
10 email = EmailField(verbose_name=_('email address'), unique=True)
11 active = BooleanField(default=True, verbose_name=_(u'active'))
12 created_at = DateTimeField(auto_now_add=True)
13 last_modified = DateTimeField(auto_now=True)
16 verbose_name = _('subscription')
17 verbose_name_plural = _('subscriptions')
19 def __unicode__(self):
23 return hashlib.sha224(self.email + settings.SECRET_KEY).hexdigest()[:30]