Jonas Havelka
2 years ago
2 changed files with 27 additions and 6 deletions
@ -0,0 +1,27 @@ |
|||||
|
# Generated by Django 3.2.15 on 2022-10-09 11:04 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
from seminar.models import Deadline |
||||
|
|
||||
|
|
||||
|
def vrat_verejnost(apps, schema_editor): |
||||
|
Cislo = apps.get_model('seminar', 'Cislo') |
||||
|
|
||||
|
for cislo in Cislo.objects.all(): |
||||
|
cislo.verejna_vysledkovka = any(cislo.deadline_v_cisle.filter(typ=Deadline.TYP_CISLA)) |
||||
|
cislo.save() |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0105_odstraneni_deadlinu_cisla'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunPython(migrations.RunPython.noop, vrat_verejnost), |
||||
|
migrations.RemoveField( |
||||
|
model_name='cislo', |
||||
|
name='verejna_vysledkovka', |
||||
|
), |
||||
|
] |
Loading…
Reference in new issue