From 1d65f5ee8e0fff787059ec1877dd9653ecb2fd52 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Wed, 20 Nov 2019 21:17:15 +0100 Subject: [PATCH] =?UTF-8?q?P=C5=99ejmenov=C3=A1no=20Cislo.cislo=20na=20.po?= =?UTF-8?q?radi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/migrations/0069_auto_20191120_2115.py | 28 +++++++++++++++++++ seminar/models.py | 2 +- seminar/testutils.py | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 seminar/migrations/0069_auto_20191120_2115.py diff --git a/seminar/migrations/0069_auto_20191120_2115.py b/seminar/migrations/0069_auto_20191120_2115.py new file mode 100644 index 00000000..04c6d1dc --- /dev/null +++ b/seminar/migrations/0069_auto_20191120_2115.py @@ -0,0 +1,28 @@ +# Generated by Django 2.2.7 on 2019-11-20 20:15 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('seminar', '0068_treenode_nazev'), + ] + + operations = [ + migrations.AlterModelOptions( + name='cislo', + options={'ordering': ['-rocnik__rocnik', '-poradi'], 'verbose_name': 'Číslo', 'verbose_name_plural': 'Čísla'}, + ), + migrations.RenameField( + model_name='cislo', + old_name='cislo', + new_name='poradi', + ), + migrations.AlterField( + model_name='problem', + name='nadproblem', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='podproblem', to='seminar.Problem', verbose_name='nadřazený problém'), + ), + ] diff --git a/seminar/models.py b/seminar/models.py index 332a5baa..327e7424 100644 --- a/seminar/models.py +++ b/seminar/models.py @@ -480,7 +480,7 @@ class Cislo(SeminarModelBase): def get(cls, rocnik, cislo): try: r = Rocnik.objects.get(rocnik=rocnik) - c = r.cisla.get(cislo=cislo) + c = r.cisla.get(poradi=cislo) except ObjectDoesNotExist: return None return c diff --git a/seminar/testutils.py b/seminar/testutils.py index 83a5ae4b..1e853d72 100644 --- a/seminar/testutils.py +++ b/seminar/testutils.py @@ -333,7 +333,7 @@ def gen_cisla(rnd, rocniky): cislo = Cislo.objects.create( rocnik = rocnik, - cislo = str(ci), + poradi = str(ci), datum_vydani=vydano, datum_deadline=deadline, verejne_db=True