mamweb/seminar/migrations/0085_nepovinna_prezdivka.py_old

35 lines
887 B
Text
Raw Normal View History

2020-06-25 01:15:01 +02:00
# Generated by Django 2.2.13 on 2020-06-24 22:57
2021-06-08 22:57:17 +02:00
# V současné době nepoužíván
2020-06-25 01:15:01 +02:00
from django.db import migrations, models
def smaz_prezdivku(apps, schema_editor):
Osoba = apps.get_model('seminar', 'Osoba')
for o in Osoba.objects.filter(prezdivka=''):
o.prezdivka = None
o.save()
def pridej_prezdivku(apps, schema_editor):
Osoba = apps.get_model('seminar', 'Osoba')
for o in Osoba.objects.filter(prezdivka=None):
o.prezdivka = ''
o.save()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0084_clanek_cislo'),
]
operations = [
migrations.AlterField(
model_name='osoba',
name='prezdivka',
2021-06-08 22:57:17 +02:00
field=models.CharField(blank=True, max_length=256, verbose_name='přezdívka'),
2020-06-25 01:15:01 +02:00
),
migrations.RunPython(smaz_prezdivku, pridej_prezdivku),
]