Browse Source

Bugfixy v migracich.

export_seznamu_prednasek
parent
commit
517b06bcda
  1. 10
      seminar/migrations/0050_auto_20190510_2228.py
  2. 2
      seminar/migrations/0051_resitel_to_osoba.py
  3. 19
      seminar/migrations/0057_reseni_to_reseni_hodnoceni.py

10
seminar/migrations/0050_auto_20190510_2228.py

@ -33,16 +33,6 @@ class Migration(migrations.Migration):
name='osoba',
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='osoba'),
),
migrations.AlterField(
model_name='uloha',
name='vzorak',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='uloha_vzorak_set', to='seminar.Text', verbose_name='vzorové řešení'),
),
migrations.AlterField(
model_name='uloha',
name='zadani',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='uloha_zadani_set', to='seminar.Text', verbose_name='veřejné zadání'),
),
migrations.CreateModel(
name='TreeNode',
fields=[

2
seminar/migrations/0051_resitel_to_osoba.py

@ -48,7 +48,7 @@ def resitel_to_osoba(apps,schema_editor):
elif o.email == u.email:
u.email = 'Použij osobu!'
else:
raise ValueError('o.email a u.email rozdílné: "{}" vs. "{}"'.format(o.email, u.first_name))
raise ValueError('o.email a u.email rozdílné: "{}" vs. "{}"'.format(o.email, u.email))
u.save()

19
seminar/migrations/0057_reseni_to_reseni_hodnoceni.py

@ -6,16 +6,21 @@ from django.db import migrations
def reseni_to_Reseni(apps, schema_editor):
Reseni = apps.get_model('seminar','Reseni')
Reseni_Resitele = apps.get_model('seminar','Reseni_Resitele')
Hodnoceni = apps.get_model('seminar','Hodnoceni')
for r in Reseni.objects.all():
r.resitele.add(r.resitel)
h = Hodnoceni.objects.create(body=r.body)
h.cislo_body = r.cislo_body
h.problem = r.problem
h.reseni = r
h.save()
r.save()
rr = Reseni_Resitele.objects.create(resitele = r.resitel, reseni=r)
if r.body == None:
print("!!!!!!!!!!!!!!!")
print(r.id,r)
print("!!!!!!!!!!!!!!!")
else:
h = Hodnoceni.objects.create(
body=r.body,
cislo_body = r.cislo_body,
problem = r.problem_old,
reseni = r)
class Migration(migrations.Migration):

Loading…
Cancel
Save