From 9c9d869e6252d1af4e4747fdfe0d0d7a4ede3d19 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Wed, 7 Dec 2016 16:15:53 +0100 Subject: [PATCH] add attachments app --- apps/attachments/__init__.py | 0 apps/attachments/admin.py | 11 ++++++ .../locale/pl/LC_MESSAGES/django.mo | Bin 0 -> 688 bytes .../locale/pl/LC_MESSAGES/django.po | 36 ++++++++++++++++++ apps/attachments/migrations/0001_initial.py | 25 ++++++++++++ apps/attachments/migrations/__init__.py | 0 apps/attachments/models.py | 16 ++++++++ redakcja/locale/pl/LC_MESSAGES/django.mo | Bin 5151 -> 5151 bytes redakcja/settings/common.py | 1 + 9 files changed, 89 insertions(+) create mode 100644 apps/attachments/__init__.py create mode 100644 apps/attachments/admin.py create mode 100644 apps/attachments/locale/pl/LC_MESSAGES/django.mo create mode 100644 apps/attachments/locale/pl/LC_MESSAGES/django.po create mode 100644 apps/attachments/migrations/0001_initial.py create mode 100644 apps/attachments/migrations/__init__.py create mode 100644 apps/attachments/models.py diff --git a/apps/attachments/__init__.py b/apps/attachments/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/apps/attachments/admin.py b/apps/attachments/admin.py new file mode 100644 index 00000000..26db450d --- /dev/null +++ b/apps/attachments/admin.py @@ -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 index 0000000000000000000000000000000000000000..11f6f59cf13dffccead68962b159d2203f06f1bd GIT binary patch literal 688 zcmZvZ&2G~`5XToNLUK8A<}gT5wW_wP11iOdOHJaG2s?=qrxM&2XX}_ayXkrjH0lWn z362~%a^wPc9smK4!Lu-%BBcjL`f0xYGn%#k+*tcW(5@mkkrr|dDG+P#kz2?I#6i9x z>&SQH3i1Q_a*2@N=x-y%<@5eW^w%-}jNb14iXLSI9a%$c&6?e@v;ZoZpHu=Qp9wft z8q6dwfg8iq$xKK?{u`ELDo#mXtCu1*v@@nhLYKLc9`u9e)8H_Kqi`_n^t#SK%#}7Y zF0*`0A6HpP6Xk)^?vt~4u|_Fm086z zK@-7e9z;R+aAZ$zMA1Q!?II%Q~bJ zu1jJ3QPQS+E1f;-SZEr`RE=|)d9e2)H%`B(G%sjd=~?N4oG;VTzgLIz(BG84@4_Qs zfbBaj+xKg*v9Syr{(T#6+A?dn49?D$b*o`pIOF0>ZL98(k<6#OkQ{&U;x&hH!SUow Z!GiyK`}1A8ux)Z7xfthUT2$$R`~|$#x#R!< literal 0 HcmV?d00001 diff --git a/apps/attachments/locale/pl/LC_MESSAGES/django.po b/apps/attachments/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 00000000..558f27e7 --- /dev/null +++ b/apps/attachments/locale/pl/LC_MESSAGES/django.po @@ -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 , 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 \n" +"Language-Team: LANGUAGE \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 index 00000000..417c500e --- /dev/null +++ b/apps/attachments/migrations/0001_initial.py @@ -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 index 00000000..e69de29b diff --git a/apps/attachments/models.py b/apps/attachments/models.py new file mode 100644 index 00000000..42c3bfa6 --- /dev/null +++ b/apps/attachments/models.py @@ -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 diff --git a/redakcja/locale/pl/LC_MESSAGES/django.mo b/redakcja/locale/pl/LC_MESSAGES/django.mo index 59cf3866ac62bc12c3e61e80f01173e084e5f2bb..a61e4d47e7a74a6325c082ada9986c1a495a72ca 100644 GIT binary patch delta 15 WcmbQQF<)atGdGiw;pSHESsVZ?7zGyq delta 15 WcmbQQF<)atGdGi=+2&U6SsVZ?F9jO_ diff --git a/redakcja/settings/common.py b/redakcja/settings/common.py index cd230deb..b5e7f097 100644 --- a/redakcja/settings/common.py +++ b/redakcja/settings/common.py @@ -136,6 +136,7 @@ INSTALLED_APPS = ( #'apiclient', 'email_mangler', 'build', + 'attachments', 'django_forms_bootstrap', 'forms_builder.forms', -- 2.20.1