From 8117261725ba0e14e9a1e6088d9bf2c38f3aa9c5 Mon Sep 17 00:00:00 2001 From: Tomas Gavenciak Date: Fri, 15 May 2015 21:27:02 +0200 Subject: [PATCH] Rozliseni formy reseni --- seminar/migrations/0008_reseni_forma.py | 20 ++++++++++++++++++++ seminar/models.py | 10 ++++++++++ 2 files changed, 30 insertions(+) create mode 100644 seminar/migrations/0008_reseni_forma.py diff --git a/seminar/migrations/0008_reseni_forma.py b/seminar/migrations/0008_reseni_forma.py new file mode 100644 index 00000000..399e81a9 --- /dev/null +++ b/seminar/migrations/0008_reseni_forma.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0007_problem_zamereni'), + ] + + operations = [ + migrations.AddField( + model_name='reseni', + name='forma', + field=models.CharField(default=b'papir', max_length=16, verbose_name='forma \u0159e\u0161en\xed', choices=[(b'papir', 'Pap\xedrov\xe9 \u0159e\u0161en\xed'), (b'email', 'Emailem'), (b'upload', 'Upload p\u0159es web')]), + preserve_default=True, + ), + ] diff --git a/seminar/models.py b/seminar/models.py index bd57f57f..aff636d4 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -380,6 +380,16 @@ class Reseni(SeminarModelBase): timestamp = models.DateTimeField(u'vytvořeno', auto_now=True) + FORMA_PAPIR = 'papir' + FORMA_EMAIL = 'email' + FORMA_UPLOAD = 'upload' + FORMA_CHOICES = [ + (FORMA_PAPIR, u'Papírové řešení'), + (FORMA_EMAIL, u'Emailem'), + (FORMA_UPLOAD, u'Upload přes web'), + ] + forma = models.CharField(u'forma řešení', max_length=16, choices=FORMA_CHOICES, blank=False, default=FORMA_PAPIR) + poznamka = models.TextField(u'neveřejná poznámka', blank=True, help_text=u'Neveřejná poznámka k řešení (plain text, editace v detailu řešení)')