1 from django.db import models
2 from django.utils.translation import ugettext_lazy as _
5 class Alias(models.Model):
6 source = models.EmailField(_('source'), db_index=True)
7 destination = models.EmailField(_('destination'))
8 mode = models.CharField(
9 _('mode'), max_length=255, default='', blank=True, choices=[
10 ('', _('Forward everything')),
11 ('@FORWARD', _('Do not forward e-mail marked as spam.'))
15 verbose_name = _('alias')
16 verbose_name_plural = _('aliases')
17 ordering = ('source', 'destination')
20 return '{} -> {}'.format(self.source, self.destination)