INSTALLED_APPS = (
'accounts.apps.AccountsConfig',
+ 'emails.apps.EmailsConfig',
'services.apps.ServicesConfig',
'ssh_keys.apps.SshKeysConfig',
--- /dev/null
+from django.contrib import admin
+from . import models
+
+
+class AliasAdmin(admin.ModelAdmin):
+ list_display = ['source', 'destination']
+
+
+admin.site.register(models.Alias, AliasAdmin)
--- /dev/null
+from django.apps import AppConfig
+from django.utils.translation import ugettext_lazy as _
+
+
+class EmailsConfig(AppConfig):
+ name = 'emails'
+ verbose_name = _('E-mails')
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-04-05 09:43+0200\n"
+"PO-Revision-Date: 2019-04-05 09:43+0200\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n"
+"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n"
+"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
+"X-Generator: Poedit 2.0.6\n"
+
+#: apps.py:7
+msgid "E-mails"
+msgstr "E-maile"
+
+#: models.py:6
+msgid "source"
+msgstr "źródło"
+
+#: models.py:7
+msgid "destination"
+msgstr "cel"
+
+#: models.py:10
+msgid "alias"
+msgstr "alias"
+
+#: models.py:11
+msgid "aliases"
+msgstr "aliasy"
--- /dev/null
+# Generated by Django 2.2 on 2019-04-05 07:37
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Alias',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('source', models.EmailField(db_index=True, max_length=254, verbose_name='source')),
+ ('destination', models.EmailField(max_length=254, verbose_name='destination')),
+ ],
+ options={
+ 'verbose_name': 'alias',
+ 'verbose_name_plural': 'aliases',
+ 'ordering': ('source', 'destination'),
+ },
+ ),
+ ]
--- /dev/null
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+
+class Alias(models.Model):
+ source = models.EmailField(_('source'), db_index=True)
+ destination = models.EmailField(_('destination'))
+
+ class Meta:
+ verbose_name = _('alias')
+ verbose_name_plural = _('aliases')
+ ordering = ('source', 'destination')
+
+ def __str__(self):
+ return '{} -> {}'.format(self.source, self.destination)