From: Jan Szejko Date: Wed, 7 Dec 2016 15:15:53 +0000 (+0100) Subject: add attachments app X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/9c9d869e6252d1af4e4747fdfe0d0d7a4ede3d19 add attachments app --- 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 00000000..11f6f59c 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 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 59cf3866..a61e4d47 100644 Binary files a/redakcja/locale/pl/LC_MESSAGES/django.mo and b/redakcja/locale/pl/LC_MESSAGES/django.mo differ 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',