From 7aa5f72e7dfb738f2600ebcae2712d2725e722f7 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Thu, 25 Aug 2016 09:18:00 +0200 Subject: [PATCH] korektury | prejmenovani autor_org zpet na autor Migrace autora z CharField na odkaz na Organizator Prejmenovani autor_org zpet na autor Oprava i Komentar maji zase jenom polozku autor, ktera ukazuje na Organizatora --- korektury/migrations/0013_rename_autor_org.py | 24 +++++++++++++++++++ korektury/models.py | 8 +++---- 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 korektury/migrations/0013_rename_autor_org.py diff --git a/korektury/migrations/0013_rename_autor_org.py b/korektury/migrations/0013_rename_autor_org.py new file mode 100644 index 00000000..db0d3151 --- /dev/null +++ b/korektury/migrations/0013_rename_autor_org.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('korektury', '0012_delete_autor'), + ] + + operations = [ + migrations.RenameField( + model_name='komentar', + old_name='autor_org', + new_name='autor', + ), + migrations.RenameField( + model_name='oprava', + old_name='autor_org', + new_name='autor', + ), + ] diff --git a/korektury/models.py b/korektury/models.py index 83881e6c..fb83b5ff 100644 --- a/korektury/models.py +++ b/korektury/models.py @@ -122,9 +122,9 @@ class Oprava(models.Model): status = models.CharField(u'stav opravy',max_length=16, choices=STATUS_CHOICES, blank=False, default = STATUS_K_OPRAVE) - autor_org = models.ForeignKey(Organizator, blank = True, + autor = models.ForeignKey(Organizator, blank = True, help_text='Autor opravy', - null = True) # TODO odstranit prizvisko User, TODO null = False + null = True) text = models.TextField(u'text opravy',blank = True, help_text='Text opravy') @@ -152,9 +152,9 @@ class Komentar(models.Model): cas = models.DateTimeField(u'čas komentáře',default=timezone.now,help_text = 'Čas zadání komentáře') oprava = models.ForeignKey(Oprava) - autor_org = models.ForeignKey(Organizator, blank = True, + autor = models.ForeignKey(Organizator, blank = True, help_text = u'Autor komentáře', - null = True) # TODO odstranit prizvisko User, TODO null = False + null = True) text = models.TextField(u'text komentáře',blank = True, help_text='Text komentáře')