msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-04-05 14:46+0200\n"
+"POT-Creation-Date: 2019-04-05 23:03+0200\n"
"PO-Revision-Date: 2019-04-05 14:46+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
msgid "Do not forward e-mail marked as spam."
msgstr "Nie przekazuj wiadomości oznaczonych jako spam."
-#: models.py:17
+#: models.py:17 models.py:36
msgid "alias"
msgstr "alias"
msgid "aliases"
msgstr "aliasy"
-#: templates/emails/my_aliases.html:7
+#: models.py:37
+msgid "date"
+msgstr "data"
+
+#: models.py:38
+msgid "count"
+msgstr "liczba"
+
+#: models.py:42 models.py:43
+#| msgid "aliases"
+msgid "alias usage"
+msgstr "użycie aliasów"
+
+#: templates/emails/my_aliases.html:8
msgid "E-mail"
msgstr "E-mail"
-#: templates/emails/my_aliases.html:9
+#: templates/emails/my_aliases.html:14
msgid "Default addresses"
msgstr "Domyślne adresy"
-#: templates/emails/my_aliases.html:16
+#: templates/emails/my_aliases.html:21
msgid "Aliases"
msgstr "Aliasy"
-#: templates/emails/my_aliases.html:20
+#: templates/emails/my_aliases.html:25
msgid "E-mail forwarded to"
msgstr "E-mail przekazywany na adres"
--- /dev/null
+# Generated by Django 2.2 on 2019-04-05 21:03
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('emails', '0002_alias_mode'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='AliasUsage',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('date', models.DateField(auto_now_add=True, verbose_name='date')),
+ ('count', models.PositiveSmallIntegerField(verbose_name='count')),
+ ('alias', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='alias', to='emails.Alias')),
+ ],
+ options={
+ 'verbose_name': 'alias usage',
+ 'verbose_name_plural': 'alias usage',
+ 'unique_together': {('alias', 'date')},
+ },
+ ),
+ ]
def get_to_user(cls, user):
lookups = ["{}@{}".format(user.username, domain) for domain in BASE_DOMAINS]
return cls.objects.filter(destination__in=lookups)
+
+
+class AliasUsage(models.Model):
+ alias = models.ForeignKey(Alias, models.CASCADE, _('alias'))
+ date = models.DateField(_('date'), auto_now_add=True)
+ count = models.PositiveSmallIntegerField(_('count'))
+
+ class Meta:
+ unique_together = (('alias', 'date'),)
+ verbose_name = _('alias usage')
+ verbose_name_plural = _('alias usage')