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