From 1a6000f0e29dd2fccb3fd9911946487da34fa0c8 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Fri, 15 May 2015 15:28:00 +0200 Subject: [PATCH] Tagy (MFIO) k problemum --- mamweb/settings_common.py | 1 + requirements.txt | 1 + seminar/migrations/0007_problem_zamereni.py | 22 +++++++++++++++++++++ seminar/models.py | 3 +++ 4 files changed, 27 insertions(+) create mode 100644 seminar/migrations/0007_problem_zamereni.py diff --git a/mamweb/settings_common.py b/mamweb/settings_common.py index e4c1db5a..02fde297 100644 --- a/mamweb/settings_common.py +++ b/mamweb/settings_common.py @@ -98,6 +98,7 @@ INSTALLED_APPS = ( 'django_countries', 'solo', 'ckeditor', + 'taggit', # MaMweb 'mamweb', diff --git a/requirements.txt b/requirements.txt index 2ba403af..d782b0d0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,7 @@ django-countries==3.2 django-solo==1.1.0 django-ckeditor==4.4.7 django-admin-tools==0.5.2 +django-taggit==0.14.0 # debug tools/extensions diff --git a/seminar/migrations/0007_problem_zamereni.py b/seminar/migrations/0007_problem_zamereni.py new file mode 100644 index 00000000..10718bd7 --- /dev/null +++ b/seminar/migrations/0007_problem_zamereni.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import taggit.managers + + +class Migration(migrations.Migration): + + dependencies = [ + ('taggit', '0001_initial'), + ('seminar', '0006_problem_add_timestamp'), + ] + + operations = [ + migrations.AddField( + model_name='problem', + name='zamereni', + field=taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text=b'Zam\xc4\x9b\xc5\x99en\xc3\xad M/F/I/O probl\xc3\xa9mu, p\xc5\x99\xc3\xadp. dal\xc5\xa1\xc3\xad tagy', verbose_name='zam\u011b\u0159en\xed'), + preserve_default=True, + ), + ] diff --git a/seminar/models.py b/seminar/models.py index a153bc38..bd57f57f 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -14,6 +14,7 @@ from django.core.urlresolvers import reverse from django_countries.fields import CountryField from solo.models import SingletonModel +from taggit.managers import TaggableManager import reversion @@ -310,6 +311,8 @@ class Problem(SeminarModelBase): ] stav = models.CharField(u'stav problému', max_length=32, choices=STAV_CHOICES, blank=False, default=STAV_NAVRH) + zamereni = TaggableManager(verbose_name=u'zaměření', help_text='Zaměření M/F/I/O problému, příp. další tagy', blank=True) + text_problemu_org = models.TextField(u'organizátorský (neveřejný) text', blank=True) text_problemu = models.TextField(u'veřejný text zadání a řešení', blank=True)