Pavel 'LEdoian' Turinsky
5 years ago
4 changed files with 115 additions and 24 deletions
@ -0,0 +1,103 @@ |
|||||
|
# Generated by Django 2.2.12 on 2020-04-01 20:54 |
||||
|
# Fixed by Pavel, 2020-01-04 20:56 UTC |
||||
|
# This is quite possibly a bug in Django. |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
import django.db.models.deletion |
||||
|
|
||||
|
def vyrob_dummy_problemy(apps, schema_editor): |
||||
|
Problem = apps.get_model('seminar', 'Problem') |
||||
|
Konfera = apps.get_model('seminar', 'Konfera') |
||||
|
for k in Konfera.objects.all(): |
||||
|
pr = Problem.objects.create(nazev=k.nazev, |
||||
|
garant=k.organizator) |
||||
|
pr.save() |
||||
|
k.problem_ptr = pr |
||||
|
k.save() |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('contenttypes', '0002_remove_content_type_name'), |
||||
|
('seminar', '0079_clanek_resitelsky'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.CreateModel( |
||||
|
name='OrgTextNode', |
||||
|
fields=[ |
||||
|
('treenode_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.TreeNode')), |
||||
|
('org_verejny', models.BooleanField(default=True, help_text='Pokud ano, bude org pod článkem podepsaný', verbose_name='Org je veřejný?')), |
||||
|
('organizator', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='seminar.Organizator', verbose_name='Organizátor')), |
||||
|
], |
||||
|
options={ |
||||
|
'verbose_name': 'Organizátorský článek (Node)', |
||||
|
'verbose_name_plural': 'Organizátorské články (Node)', |
||||
|
'db_table': 'seminar_nodes_orgtextnode', |
||||
|
}, |
||||
|
bases=('seminar.treenode',), |
||||
|
), |
||||
|
migrations.RenameModel( |
||||
|
old_name='OtisteneReseniNode', |
||||
|
new_name='ReseniNode', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konferanode', |
||||
|
name='konfera', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konferanode', |
||||
|
name='treenode_ptr', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='clanek', |
||||
|
name='cislo', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='clanek', |
||||
|
name='resitelsky', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='reseni', |
||||
|
name='text_zkraceny', |
||||
|
), |
||||
|
migrations.AddField( |
||||
|
model_name='konfera', |
||||
|
name='problem_ptr', |
||||
|
field=models.OneToOneField(auto_created=True, null=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem'), |
||||
|
preserve_default=False, |
||||
|
), |
||||
|
migrations.RunPython(vyrob_dummy_problemy), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konfera', |
||||
|
name='id', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konfera', |
||||
|
name='nazev', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konfera', |
||||
|
name='organizator', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konfera', |
||||
|
name='poznamka', |
||||
|
), |
||||
|
migrations.RemoveField( |
||||
|
model_name='konfera', |
||||
|
name='reseni', |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='reseni', |
||||
|
name='text_cely', |
||||
|
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='reseni_cely_set', to='seminar.ReseniNode', verbose_name='Plná verze textu řešení'), |
||||
|
), |
||||
|
migrations.DeleteModel( |
||||
|
name='ClanekNode', |
||||
|
), |
||||
|
migrations.DeleteModel( |
||||
|
name='KonferaNode', |
||||
|
), |
||||
|
] |
Loading…
Reference in new issue