|
|
@ -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): |
|
|
|