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