|
|
@ -1,11 +1,6 @@ |
|
|
|
from django.db import migrations |
|
|
|
|
|
|
|
def oprav_ulohy(apps, schema_editor): |
|
|
|
Problem = apps.get_model('seminar', 'Pohadka') |
|
|
|
|
|
|
|
for p in Problem.objects.filter(typ="b'uloha'"): |
|
|
|
p.typ = "uloha" |
|
|
|
p.save() |
|
|
|
sql = "update seminar_problemy set typ = 'uloha' where typ like 'b_uloha_';" |
|
|
|
|
|
|
|
class Migration(migrations.Migration): |
|
|
|
|
|
|
@ -14,6 +9,6 @@ class Migration(migrations.Migration): |
|
|
|
] |
|
|
|
|
|
|
|
operations = [ |
|
|
|
migrations.RunPython(oprav_ulohy, oprav_ulohy), |
|
|
|
migrations.RunSQL(sql, sql), |
|
|
|
] |
|
|
|
|
|
|
|