6d100a38092e6bbdc5a2297df9b982b809488c39
[wolnelektury.git] / src / newsletter / models.py
1 # -*- coding: utf-8 -*-
2 from django.db.models import Model, EmailField, DateTimeField, BooleanField
3 from django.utils.translation import ugettext_lazy as _
4
5
6 class Subscription(Model):
7     email = EmailField(verbose_name=_('email address'), unique=True)
8     active = BooleanField(default=True, verbose_name=_(u'active'))
9     created_at = DateTimeField(auto_now_add=True)
10     last_modified = DateTimeField(auto_now=True)
11
12     class Meta:
13         verbose_name = _('subscription')
14         verbose_name_plural = _('subscriptions')
15
16     def __unicode__(self):
17         return self.email