From 4fdc0ac0eca04aa3c05d5325a07269112f86ff7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Koci=C3=A1n?= Date: Wed, 17 Feb 2016 16:13:11 +0100 Subject: [PATCH] =?UTF-8?q?Poh=C3=A1dka:=20nepovinn=C3=BD=20autor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * migrace --- .../0040_pohadka_nepovinny_autor.py | 20 +++++++++++++++++++ seminar/models.py | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 seminar/migrations/0040_pohadka_nepovinny_autor.py diff --git a/seminar/migrations/0040_pohadka_nepovinny_autor.py b/seminar/migrations/0040_pohadka_nepovinny_autor.py new file mode 100644 index 00000000..092cb578 --- /dev/null +++ b/seminar/migrations/0040_pohadka_nepovinny_autor.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0039_pohadka'), + ] + + operations = [ + migrations.AlterField( + model_name='pohadka', + name='autor', + field=models.ForeignKey(verbose_name=b'Autor poh\xc3\xa1dky', to=settings.AUTH_USER_MODEL, null=True), + ), + ] diff --git a/seminar/models.py b/seminar/models.py index 21292580..00d49449 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -612,7 +612,11 @@ class Pohadka(SeminarModelBase): autor = models.ForeignKey( settings.AUTH_USER_MODEL, - verbose_name="Autor pohádky" + verbose_name="Autor pohádky", + + # Při nahrávání z TeXu není vyplnění vyžadováno, v adminu je + null=True, + blank=False ) timestamp = models.DateTimeField(