# 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.DeleteModel(
            name='Konfery_Ucastnici',
        ),
        migrations.RemoveField(
            model_name='konfera',
            name='ucastnici',
        ),
        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.RemoveField(
            model_name='konfera',
            name='id',
        ),
        migrations.RenameModel(
            old_name='OtisteneReseniNode',
            new_name='ReseniNode',
        ),
        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=False, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem'),
            preserve_default=False,
        ),
        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',
        ),
        migrations.CreateModel(
            name='Konfery_Ucastnici',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k účasti (plain text)', verbose_name='neveřejná poznámka')),
                ('konfera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Konfera', verbose_name='konfera')),
                ('resitel', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Resitel', verbose_name='řešitel')),
            ],
            options={
                'verbose_name': 'Účast na konfeře',
                'verbose_name_plural': 'Účasti na konfeře',
                'db_table': 'seminar_konfery_ucastnici',
                'ordering': ['konfera', 'resitel'],
            },
        ),
        migrations.AddField(
            model_name='konfera',
            name='ucastnici',
            field=models.ManyToManyField(help_text='Seznam účastníků konfery', through='seminar.Konfery_Ucastnici', to='seminar.Resitel', verbose_name='účastníci konfery'),
        ),
    ]