Browse Source

Přejmenováno Cislo.cislo na .poradi

export_seznamu_prednasek
Pavel 'LEdoian' Turinsky 5 years ago
parent
commit
1d65f5ee8e
  1. 28
      seminar/migrations/0069_auto_20191120_2115.py
  2. 2
      seminar/models.py
  3. 2
      seminar/testutils.py

28
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'),
),
]

2
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

2
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

Loading…
Cancel
Save