Přejmenováno Cislo.cislo na .poradi
This commit is contained in:
parent
112782699b
commit
1d65f5ee8e
3 changed files with 30 additions and 2 deletions
28
seminar/migrations/0069_auto_20191120_2115.py
Normal file
28
seminar/migrations/0069_auto_20191120_2115.py
Normal file
|
@ -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'),
|
||||
),
|
||||
]
|
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue