--- /dev/null
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('catalogue', '0005_auto_20150505_1229'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='Category',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('label', models.CharField(max_length=64, verbose_name='category')),
+ ('label_en', models.CharField(max_length=64, null=True, verbose_name='category')),
+ ('label_pl', models.CharField(max_length=64, null=True, verbose_name='category')),
+ ('index', models.IntegerField()),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Tag',
+ fields=[
+ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
+ ('label', models.CharField(max_length=64, verbose_name='tag')),
+ ('label_en', models.CharField(max_length=64, null=True, verbose_name='tag')),
+ ('label_pl', models.CharField(max_length=64, null=True, verbose_name='tag')),
+ ('index', models.IntegerField()),
+ ('category', models.ForeignKey(to='catalogue.Category')),
+ ],
+ ),
+ ]
from catalogue.models.document import Document
from catalogue.models.plan import Plan
from catalogue.models.publish_log import PublishRecord
-#from catalogue.models.book import Book
-#from catalogue.models.listeners import *
+from catalogue.models.tag import Category, Tag
+# from catalogue.models.book import Book
+# from catalogue.models.listeners import *
from django.contrib.auth.models import User as AuthUser
+
class User(AuthUser):
class Meta:
proxy = True
--- /dev/null
+# -*- coding: utf-8 -*-
+#
+# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+from __future__ import unicode_literals
+
+from django.db import models
+from django.utils.translation import ugettext_lazy as _
+
+
+class Category(models.Model):
+ label = models.CharField(max_length=64, verbose_name=_('category'))
+ index = models.IntegerField()
+
+
+class Tag(models.Model):
+ label = models.CharField(max_length=64, verbose_name=_('tag'))
+ category = models.ForeignKey(Category)
+ index = models.IntegerField()
--- /dev/null
+# -*- coding: utf-8 -*-
+#
+# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+
+from modeltranslation.translator import translator, TranslationOptions
+from catalogue.models import Tag, Category
+
+
+class TagTranslationOptions(TranslationOptions):
+ fields = ('label',)
+
+
+class CategoryTranslationOptions(TranslationOptions):
+ fields = ('label',)
+
+
+translator.register(Tag, TagTranslationOptions)
+translator.register(Category, CategoryTranslationOptions)