add attachments app
authorJan Szejko <janek37@gmail.com>
Wed, 7 Dec 2016 15:15:53 +0000 (16:15 +0100)
committerJan Szejko <janek37@gmail.com>
Wed, 7 Dec 2016 15:15:53 +0000 (16:15 +0100)
apps/attachments/__init__.py [new file with mode: 0644]
apps/attachments/admin.py [new file with mode: 0644]
apps/attachments/locale/pl/LC_MESSAGES/django.mo [new file with mode: 0644]
apps/attachments/locale/pl/LC_MESSAGES/django.po [new file with mode: 0644]
apps/attachments/migrations/0001_initial.py [new file with mode: 0644]
apps/attachments/migrations/__init__.py [new file with mode: 0644]
apps/attachments/models.py [new file with mode: 0644]
redakcja/locale/pl/LC_MESSAGES/django.mo
redakcja/settings/common.py

diff --git a/apps/attachments/__init__.py b/apps/attachments/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/attachments/admin.py b/apps/attachments/admin.py
new file mode 100644 (file)
index 0000000..26db450
--- /dev/null
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+from django.contrib import admin
+
+from attachments.models import Attachment
+
+
+class AttachmentAdmin(admin.ModelAdmin):
+    list_display = ('key',)
+    search_fields = ('key',)
+
+admin.site.register(Attachment, AttachmentAdmin)
diff --git a/apps/attachments/locale/pl/LC_MESSAGES/django.mo b/apps/attachments/locale/pl/LC_MESSAGES/django.mo
new file mode 100644 (file)
index 0000000..11f6f59
Binary files /dev/null and b/apps/attachments/locale/pl/LC_MESSAGES/django.mo differ
diff --git a/apps/attachments/locale/pl/LC_MESSAGES/django.po b/apps/attachments/locale/pl/LC_MESSAGES/django.po
new file mode 100644 (file)
index 0000000..558f27e
--- /dev/null
@@ -0,0 +1,36 @@
+# 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.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-12-07 16:09+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
+"|| n%100>=20) ? 1 : 2);\n"
+
+#: models.py:8
+msgid "key"
+msgstr "klucz"
+
+#: models.py:7
+msgid "A unique name for this attachment"
+msgstr "Unikalna nazwa dla tego załącznika"
+
+#: models.py:12
+msgid "attachment"
+msgstr "załącznik"
+
+#: models.py:12
+msgid "attachments"
+msgstr "załączniki"
diff --git a/apps/attachments/migrations/0001_initial.py b/apps/attachments/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..417c500
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Attachment',
+            fields=[
+                ('key', models.CharField(help_text='A unique name for this attachment', max_length=255, serialize=False, verbose_name='key', primary_key=True)),
+                ('attachment', models.FileField(upload_to=b'attachment')),
+            ],
+            options={
+                'ordering': ('key',),
+                'verbose_name': 'attachment',
+                'verbose_name_plural': 'attachments',
+            },
+        ),
+    ]
diff --git a/apps/attachments/migrations/__init__.py b/apps/attachments/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/apps/attachments/models.py b/apps/attachments/models.py
new file mode 100644 (file)
index 0000000..42c3bfa
--- /dev/null
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+
+class Attachment(models.Model):
+    key = models.CharField(_('key'), help_text=_('A unique name for this attachment'), primary_key=True, max_length=255)
+    attachment = models.FileField(upload_to='attachment')
+
+    class Meta:
+        ordering = ('key',)
+        verbose_name, verbose_name_plural = _('attachment'), _('attachments')
+
+    def __unicode__(self):
+        return self.key
index 59cf386..a61e4d4 100644 (file)
Binary files a/redakcja/locale/pl/LC_MESSAGES/django.mo and b/redakcja/locale/pl/LC_MESSAGES/django.mo differ
index cd230de..b5e7f09 100644 (file)
@@ -136,6 +136,7 @@ INSTALLED_APPS = (
     #'apiclient',
     'email_mangler',
     'build',
+    'attachments',
 
     'django_forms_bootstrap',
     'forms_builder.forms',