Browse Source

Merge branch 'data_migrations' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into data_migrations

export_seznamu_prednasek
Anet 5 years ago
parent
commit
327aa64479
  1. 2
      galerie/migrations/0001_initial.py
  2. 2
      korektury/migrations/0010_Pridani_odkazu_na_organizatora.py
  3. 2
      korektury/migrations/0014_add_org_to_pdf.py
  4. 2
      prednasky/migrations/0001_initial.py
  5. 2
      prednasky/migrations/0005_auto_20160929_0153.py
  6. 37
      seminar/forms.py
  7. 251
      seminar/migrations/0001_initial.py
  8. 670
      seminar/migrations/0001_reset.py
  9. 2164
      seminar/migrations/0001_squashed_0067_auto_20190814_0805.py
  10. 48
      seminar/migrations/0002_add_body_views.py
  11. 32
      seminar/migrations/0003_add_skola_zs_ss.py
  12. 44
      seminar/migrations/0004_add_old_dakos_id.py
  13. 21
      seminar/migrations/0005_alter_problem_autor.py
  14. 28
      seminar/migrations/0006_problem_add_timestamp.py
  15. 22
      seminar/migrations/0007_problem_zamereni.py
  16. 20
      seminar/migrations/0008_reseni_forma.py
  17. 47
      seminar/migrations/0009_rename_imported_IDs.py
  18. 20
      seminar/migrations/0010_alter_rok_maturity.py
  19. 39
      seminar/migrations/0011_alter_timestamp_def.py
  20. 18
      seminar/migrations/0012_remove_soustredeni_ucastnici.py
  21. 36
      seminar/migrations/0013_soustredeni_ucastnici_through_model.py
  22. 50
      seminar/migrations/0014_uprava_poznamek.py
  23. 20
      seminar/migrations/0015_soustredeni_text.py
  24. 42
      seminar/migrations/0016_texty_problemu.py
  25. 20
      seminar/migrations/0017_texty_problemu_minor.py
  26. 36
      seminar/migrations/0018_problemnavrh_problemzadany.py
  27. 32
      seminar/migrations/0019_rocnik_ciselne.py
  28. 44
      seminar/migrations/0020_indexy_a_razeni.py
  29. 20
      seminar/migrations/0021_cislo_verejna_vysledkovka.py
  30. 29
      seminar/migrations/0022_decimal_body.py
  31. 32
      seminar/migrations/0023_add_novinky.py
  32. 35
      seminar/migrations/0024_add_organizator.py
  33. 20
      seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py
  34. 20
      seminar/migrations/0026_soustredeni_typ.py
  35. 32
      seminar/migrations/0027_export_flag_a_typ_akce.py
  36. 75
      seminar/migrations/0028_add_body_celkem_views.py
  37. 51
      seminar/migrations/0029_fix_body_celkem_views.py
  38. 60
      seminar/migrations/0030_add_vysledky.py
  39. 21
      seminar/migrations/0031_cislo_pdf.py
  40. 44
      seminar/migrations/0032_cislo_pdf_blank_typos.py
  41. 20
      seminar/migrations/0033_organizator_studuje_popisek.py
  42. 20
      seminar/migrations/0034_reseni_forma_default_email.py
  43. 25
      seminar/migrations/0035_django_imagekit.py
  44. 36
      seminar/migrations/0036_add_org_to_soustredeni.py
  45. 29
      seminar/migrations/0037_prispevek.py
  46. 18
      seminar/migrations/0038_change_meta_prispevek.py
  47. 34
      seminar/migrations/0039_pohadka.py
  48. 20
      seminar/migrations/0040_pohadka_nepovinny_autor.py
  49. 71
      seminar/migrations/0041_konfery.py
  50. 31
      seminar/migrations/0042_auto_20161005_0847.py
  51. 19
      seminar/migrations/0042_cislo_faze.py
  52. 19
      seminar/migrations/0043_uprava_faze.py
  53. 19
      seminar/migrations/0044_uprava_faze.py
  54. 19
      seminar/migrations/0045_cislo_pridani_faze_nahrano.py
  55. 15
      seminar/migrations/0046_merge.py
  56. 19
      seminar/migrations/0047_auto_20170120_2118.py
  57. 19
      seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py
  58. 508
      seminar/migrations/0049_auto_20190430_2354.py
  59. 191
      seminar/migrations/0050_auto_20190510_2228.py
  60. 89
      seminar/migrations/0051_resitel_to_osoba.py
  61. 82
      seminar/migrations/0052_user_to_organizator.py
  62. 36
      seminar/migrations/0053_organizator_organizuje_od_do.py
  63. 56
      seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py
  64. 47
      seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py
  65. 34
      seminar/migrations/0057_reseni_to_reseni_hodnoceni.py
  66. 161
      seminar/migrations/0058_problem_to_uloha_tema_clanek.py
  67. 29
      seminar/migrations/0059_vytvorit_pohadkanode.py
  68. 112
      seminar/migrations/0060_spoj_stromy.py
  69. 153
      seminar/migrations/0061_kill_frankenstein.py
  70. 33
      seminar/migrations/0062_redukce_modelu_pohadky.py
  71. 35
      seminar/migrations/0063_procisteni_migraci.py
  72. 162
      seminar/migrations/0064_auto_20190610_2358.py
  73. 31
      seminar/migrations/0065_treenode_polymorphic_ctype.py
  74. 29
      seminar/migrations/0066_problem_polymorphic_ctype.py
  75. 18
      seminar/migrations/0067_auto_20190814_0805.py
  76. 87
      seminar/views.py

2
galerie/migrations/0001_initial.py

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('seminar', '0001_reset'),
('seminar', '0033_organizator_studuje_popisek'),
]
operations = [

2
korektury/migrations/0010_Pridani_odkazu_na_organizatora.py

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0001_reset'),
('seminar', '0041_konfery'),
('korektury', '0009_trizeni_korektur_v_seznamu'),
]

2
korektury/migrations/0014_add_org_to_pdf.py

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0001_reset'),
('seminar', '0041_konfery'),
('korektury', '0013_rename_autor_org'),
]

2
prednasky/migrations/0001_initial.py

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0001_reset'),
('seminar', '0036_add_org_to_soustredeni'),
]
operations = [

2
prednasky/migrations/0005_auto_20160929_0153.py

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0001_reset'),
('seminar', '0041_konfery'),
('prednasky', '0004_remove_prednaska_seznam'),
]

37
seminar/forms.py

@ -1,9 +1,12 @@
from django import forms
from dal import autocomplete
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
from .models import Skola, Resitel
from .models import Skola, Resitel, Osoba
from datetime import date
import logging
class LoginForm(forms.Form):
username = forms.CharField(label='Přihlašovací jméno',
@ -71,8 +74,37 @@ class PrihlaskaForm(forms.Form):
zasilat = forms.ChoiceField(label='Kam zasílat čísla a řešení',choices = Resitel.ZASILAT_CHOICES, required=True)
gdpr = forms.BooleanField(label='Souhlasím se zpracováním osobních údajů', required=True)
spam = forms.BooleanField(label='Souhlasím se zasíláním materiálů od MFF UK', required=False)
def clean_username(self):
err_logger = logging.getLogger('seminar.prihlaska.problem')
username = self.cleaned_data.get('username')
try:
User.objects.get(username=username)
msg = "Username {} exists".format(username)
err_logger.info(msg)
raise forms.ValidationError('Přihlašovací jméno je již použito')
except ObjectDoesNotExist:
pass
def clean_email(self):
err_logger = logging.getLogger('seminar.prihlaska.problem')
email = self.cleaned_data.get('email')
try:
Osoba.objects.get(email=email)
msg = "Email {} exists".format(email)
err_logger.info(msg)
raise forms.ValidationError('Email je již použit')
except ObjectDoesNotExist:
pass
def clean(self):
super().clean()
err_logger = logging.getLogger('seminar.prihlaska.problem')
data = self.cleaned_data
if data.get('password') != data.get('password_check'):
self.add_error('password_check',forms.ValidationError('Hesla se neshodují'))
@ -87,6 +119,3 @@ class PrihlaskaForm(forms.Form):
self.add_error('skola_nazev',forms.ValidationError('Je nutné vyplnit název školy'))
elif data.get('skola_adresa')=='':
self.add_error('skola_adresa',forms.ValidationError('Je nutné vyplnit adresu školy'))
from seminar.models import Resitel

251
seminar/migrations/0001_initial.py

@ -0,0 +1,251 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
import seminar.models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='VysledkyKCislu',
fields=[
('dummy_id', models.CharField(max_length=32, serialize=False, verbose_name='dummy ID pro view', primary_key=True, db_column='id')),
('body', models.IntegerField(verbose_name='body za \u010d\xedslo', db_column='body')),
('body_celkem', models.IntegerField(verbose_name='body celkem do \u010d\xedsla', db_column='body_celkem')),
],
options={
'abstract': False,
'db_table': 'seminar_body_k_cislu',
'managed': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='VysledkyZaCislo',
fields=[
('dummy_id', models.CharField(max_length=32, serialize=False, verbose_name='dummy ID pro view', primary_key=True, db_column='id')),
('body', models.IntegerField(verbose_name='body za \u010d\xedslo', db_column='body')),
],
options={
'abstract': False,
'db_table': 'seminar_body_za_cislo',
'managed': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Cislo',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('cislo', models.CharField(help_text='V\u011bt\u0161inou jen "1", vyj\xedme\u010dn\u011b "7-8", lexikograficky ur\u010dije po\u0159ad\xed v ro\u010dn\xedku!', max_length=32, verbose_name='n\xe1zev \u010d\xedsla')),
('datum_vydani', models.DateField(help_text='Datum vyd\xe1n\xed fin\xe1ln\xed verze', null=True, verbose_name='datum vyd\xe1n\xed', blank=True)),
('datum_deadline', models.DateField(help_text='Datum pro p\u0159\xedjem \u0159e\u0161en\xed \xfaloh zadan\xfdch v tomto \u010d\xedsle', null=True, verbose_name='datum deadline', blank=True)),
('verejne_db', models.BooleanField(default=False, verbose_name='\u010d\xedslo zve\u0159ejn\u011bno', db_column='verejne')),
],
options={
'ordering': ['rocnik__rocnik', 'cislo'],
'db_table': 'seminar_cisla',
'verbose_name': '\u010c\xedslo',
'verbose_name_plural': '\u010c\xedsla',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Nastaveni',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('aktualni_cislo', models.ForeignKey(verbose_name='posledn\xed vydan\xe9 \u010d\xedslo', to='seminar.Cislo', on_delete=models.CASCADE)),
],
options={
'db_table': 'seminar_nastaveni',
'verbose_name': 'Nastaven\xed semin\xe1\u0159e',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='PrilohaReseni',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('timestamp', models.DateTimeField(auto_now=True, verbose_name='vytvo\u0159eno')),
('soubor', models.FileField(upload_to=seminar.models.generate_filename, verbose_name='soubor')),
('poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k p\u0159\xedloze \u0159e\u0161en\xed (plain text), nap\u0159. o p\u016fvodu', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
],
options={
'ordering': ['reseni', 'timestamp'],
'db_table': 'seminar_priloha_reseni',
'verbose_name': 'P\u0159\xedloha \u0159e\u0161en\xed',
'verbose_name_plural': 'P\u0159\xedlohy \u0159e\u0161en\xed',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Problem',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('nazev', models.CharField(max_length=256, verbose_name='n\xe1zev')),
('typ', models.CharField(default=b'uloha', max_length=32, verbose_name='typ probl\xe9mu', choices=[(b'uloha', '\xdaloha'), (b'tema', 'T\xe9ma'), (b'serial', 'Seri\xe1l'), (b'org-clanek', 'Organiz\xe1torsk\xfd \u010dl\xe1nek'), (b'res-clanek', '\u0158esitelsk\xfd \u010dl\xe1nek')])),
('stav', models.CharField(default=b'navrh', max_length=32, verbose_name='stav probl\xe9mu', choices=[(b'navrh', 'N\xe1vrh'), (b'zadany', 'Zadan\xfd'), (b'smazany', 'Smazan\xfd')])),
('text_problemu_org', models.TextField(verbose_name='organiz\xe1torsk\xfd (neve\u0159ejn\xfd) text', blank=True)),
('text_problemu', models.TextField(verbose_name='ve\u0159ejn\xfd text zad\xe1n\xed a \u0159e\u0161en\xed', blank=True)),
('kod', models.CharField(default=b'', help_text='\u010c\xedslo/k\xf3d \xfalohy v \u010d\xedsle nebo k\xf3d t\xe9matu/\u010dl\xe1nku/seri\xe1lu v ro\u010dn\xedku', max_length=32, verbose_name='lok\xe1ln\xed k\xf3d', blank=True)),
('body', models.IntegerField(null=True, verbose_name='maximum bod\u016f', blank=True)),
('autor', models.ForeignKey(related_name='autor_uloh', verbose_name='autor probl\xe9mu', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('cislo_reseni', models.ForeignKey(related_name='resene_problemy', blank=True, to='seminar.Cislo', help_text='\u010c\xedslo s \u0159e\u0161en\xedm \xfalohy, jen pro \xfalohy', null=True, verbose_name='\u010d\xedslo \u0159e\u0161en\xed', on_delete=models.CASCADE)),
('cislo_zadani', models.ForeignKey(related_name='zadane_problemy', verbose_name='\u010d\xedslo zad\xe1n\xed', blank=True, to='seminar.Cislo', null=True, on_delete=models.CASCADE)),
('opravovatel', models.ForeignKey(related_name='opravovatel_uloh', verbose_name='opravovatel', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
],
options={
'db_table': 'seminar_problemy',
'verbose_name': 'Probl\xe9m',
'verbose_name_plural': 'Probl\xe9my',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Reseni',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('body', models.IntegerField(null=True, verbose_name='body', blank=True)),
('timestamp', models.DateTimeField(auto_now=True, verbose_name='vytvo\u0159eno')),
('poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \u0159e\u0161en\xed (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
('cislo_body', models.ForeignKey(related_name='bodovana_reseni', verbose_name='\u010d\xedslo pro body', blank=True, to='seminar.Cislo', null=True, on_delete=models.CASCADE)),
('problem', models.ForeignKey(related_name='reseni', verbose_name='probl\xe9m', to='seminar.Problem', on_delete=models.CASCADE)),
],
options={
'ordering': ['problem', 'resitel'],
'db_table': 'seminar_reseni',
'verbose_name': '\u0158e\u0161en\xed',
'verbose_name_plural': '\u0158e\u0161en\xed',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Resitel',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('jmeno', models.CharField(max_length=256, verbose_name='jm\xe9no')),
('prijmeni', models.CharField(max_length=256, verbose_name='p\u0159\xedjmen\xed')),
('pohlavi_muz', models.BooleanField(default=False, verbose_name='pohlav\xed (mu\u017e)')),
('rok_maturity', models.IntegerField(verbose_name='rok maturity')),
('email', models.EmailField(default=b'', max_length=256, verbose_name='e-mail', blank=True)),
('telefon', models.CharField(default=b'', max_length=256, verbose_name='telefon', blank=True)),
('datum_narozeni', models.DateField(null=True, verbose_name='datum narozen\xed', blank=True)),
('datum_souhlasu_udaje', models.DateField(help_text='Datum souhlasu se zpracov\xe1n\xedm osobn\xedch \xfadaj\u016f', null=True, verbose_name='datum souhlasu (\xfadaje)', blank=True)),
('datum_souhlasu_zasilani', models.DateField(help_text='Datum souhlasu se zas\xedl\xe1n\xedm MFF materi\xe1l\u016f', null=True, verbose_name='datum souhlasu (spam)', blank=True)),
('datum_prihlaseni', models.DateField(default=django.utils.timezone.now, verbose_name='datum p\u0159ihl\xe1\u0161en\xed')),
('zasilat', models.CharField(default=b'domu', max_length=32, verbose_name='kam zas\xedlat', choices=[(b'domu', 'Dom\u016f'), (b'do_skoly', 'Do \u0161koly'), (b'nikam', 'Nikam')])),
('ulice', models.CharField(default=b'', max_length=256, verbose_name='ulice', blank=True)),
('mesto', models.CharField(default=b'', max_length=256, verbose_name='m\u011bsto', blank=True)),
('psc', models.CharField(default=b'', max_length=32, verbose_name='PS\u010c', blank=True)),
('stat', django_countries.fields.CountryField(default=b'CZ', help_text='ISO 3166-1 k\xf3d zem\u011b velk\xfdmi p\xedsmeny (CZ, SK, ...)', max_length=2, verbose_name='st\xe1t')),
('poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \u0159e\u0161iteli (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
],
options={
'ordering': ['prijmeni', 'jmeno'],
'db_table': 'seminar_resitele',
'verbose_name': '\u0158e\u0161itel',
'verbose_name_plural': '\u0158e\u0161itel\xe9',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Rocnik',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('prvni_rok', models.IntegerField(verbose_name='prvn\xed rok')),
('rocnik', models.CharField(max_length=16, verbose_name='\u010d\xedslo ro\u010dn\xedku')),
],
options={
'ordering': ['rocnik'],
'db_table': 'seminar_rocniky',
'verbose_name': 'Ro\u010dn\xedk',
'verbose_name_plural': 'Ro\u010dn\xedky',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Skola',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('aesop_id', models.CharField(default=b'', help_text='Aesopi ID typu "izo:..." nebo "aesop:..."', max_length=32, verbose_name='Aesop ID', blank=True)),
('izo', models.CharField(help_text='IZO \u0161koly (jen \u010desk\xe9 \u0161koly)', max_length=32, verbose_name='IZO', blank=True)),
('nazev', models.CharField(help_text='Cel\xfd n\xe1zev \u0161koly', max_length=256, verbose_name='n\xe1zev')),
('kratky_nazev', models.CharField(help_text=b'Zkr\xc3\xa1cen\xc3\xbd n\xc3\xa1zev pro zobrazen\xc3\xad ve v\xc3\xbdsledkovce', max_length=256, verbose_name='zkr\xe1cen\xfd n\xe1zev', blank=True)),
('ulice', models.CharField(max_length=256, verbose_name='ulice')),
('mesto', models.CharField(max_length=256, verbose_name='m\u011bsto')),
('psc', models.CharField(max_length=32, verbose_name='PS\u010c')),
('stat', django_countries.fields.CountryField(default=b'CZ', help_text='ISO 3166-1 k\xf3d zeme velk\xfdmi p\xedsmeny (CZ, SK, ...)', max_length=2, verbose_name='st\xe1t')),
('poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka ke \u0161kole (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
],
options={
'db_table': 'seminar_skoly',
'verbose_name': '\u0160kola',
'verbose_name_plural': '\u0160koly',
},
bases=(models.Model,),
),
migrations.CreateModel(
name='Soustredeni',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('datum_zacatku', models.DateField(help_text='Prvn\xed den soust\u0159ed\u011bn\xed', null=True, verbose_name='datum za\u010d\xe1tku', blank=True)),
('datum_konce', models.DateField(help_text='Posledn\xed den soust\u0159ed\u011bn\xed', null=True, verbose_name='datum konce', blank=True)),
('verejne_db', models.BooleanField(default=False, verbose_name='soust\u0159ed\u011bn\xed zve\u0159ejn\u011bno', db_column='verejne')),
('misto', models.CharField(default=b'', help_text='M\xedsto (n\xe1zev obce, voliteln\u011b t\xe9\u017e objektu', max_length=256, verbose_name='m\xedsto soust\u0159ed\u011bn\xed', blank=True)),
('rocnik', models.ForeignKey(related_name='soustredeni', verbose_name='ro\u010dn\xedk', to='seminar.Rocnik', on_delete=models.CASCADE)),
('ucastnici', models.ManyToManyField(help_text='Seznam \xfa\u010dastn\xedk\u016f soust\u0159ed\u011bn\xed', to='seminar.Resitel', db_table='seminar_soustredeni_ucastnici', verbose_name='\xfa\u010dastn\xedci soust\u0159ed\u011bn\xed')),
],
options={
'ordering': ['rocnik__rocnik', 'datum_zacatku'],
'db_table': 'seminar_soustredeni',
'verbose_name': 'Soust\u0159ed\u011bn\xed',
'verbose_name_plural': 'Soust\u0159ed\u011bn\xed',
},
bases=(models.Model,),
),
migrations.AddField(
model_name='resitel',
name='skola',
field=models.ForeignKey(verbose_name='\u0161kola', blank=True, to='seminar.Skola', null=True, on_delete=models.CASCADE),
preserve_default=True,
),
migrations.AddField(
model_name='resitel',
name='user',
field=models.OneToOneField(null=True, blank=True, to=settings.AUTH_USER_MODEL, verbose_name='u\u017eivatel', on_delete=models.CASCADE),
preserve_default=True,
),
migrations.AddField(
model_name='reseni',
name='resitel',
field=models.ForeignKey(related_name='reseni', verbose_name='\u0159e\u0161itel', to='seminar.Resitel', on_delete=models.CASCADE),
preserve_default=True,
),
migrations.AddField(
model_name='prilohareseni',
name='reseni',
field=models.ForeignKey(related_name='prilohy', verbose_name='\u0159e\u0161en\xed', to='seminar.Reseni', on_delete=models.CASCADE),
preserve_default=True,
),
migrations.AddField(
model_name='nastaveni',
name='aktualni_rocnik',
field=models.ForeignKey(verbose_name='aktu\xe1ln\xed ro\u010dn\xedk', to='seminar.Rocnik', on_delete=models.CASCADE),
preserve_default=True,
),
migrations.AddField(
model_name='cislo',
name='rocnik',
field=models.ForeignKey(related_name='cisla', verbose_name='ro\u010dn\xedk', to='seminar.Rocnik', on_delete=models.CASCADE),
preserve_default=True,
),
]

670
seminar/migrations/0001_reset.py

@ -1,670 +0,0 @@
# Generated by Django 2.2.4 on 2019-08-19 18:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_countries.fields
import imagekit.models.fields
import seminar.models
import taggit.managers
class Migration(migrations.Migration):
initial = True
dependencies = [
('taggit', '0003_taggeditem_add_unique_index'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
name='Cislo',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('cislo', models.CharField(db_index=True, help_text='Většinou jen "1", vyjímečně "7-8", lexikograficky určuje pořadí v ročníku!', max_length=32, verbose_name='název čísla')),
('datum_vydani', models.DateField(blank=True, help_text='Datum vydání finální verze', null=True, verbose_name='datum vydání')),
('datum_deadline', models.DateField(blank=True, help_text='Datum pro příjem řešení úloh zadaných v tomto čísle', null=True, verbose_name='datum deadline')),
('datum_deadline_soustredeni', models.DateField(blank=True, help_text='Datum pro příjem řešení pro účast na soustředění', null=True, verbose_name='datum deadline soustředění')),
('verejne_db', models.BooleanField(db_column='verejne', default=False, verbose_name='číslo zveřejněno')),
('verejna_vysledkovka', models.BooleanField(default=False, help_text='Je-li false u veřejného čísla, není výsledkovka zatím veřejná.', verbose_name='zveřejněna výsledkovka')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k číslu (plain text)', verbose_name='neveřejná poznámka')),
('pdf', models.FileField(blank=True, help_text='Pdf čísla, které si mohou řešitelé stáhnout', null=True, upload_to=seminar.models.cislo_pdf_filename, verbose_name='pdf')),
],
options={
'verbose_name': 'Číslo',
'verbose_name_plural': 'Čísla',
'db_table': 'seminar_cisla',
'ordering': ['-rocnik__rocnik', '-cislo'],
},
),
migrations.CreateModel(
name='Hodnoceni',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('body', models.DecimalField(decimal_places=1, max_digits=8, verbose_name='body')),
('cislo_body', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='hodnoceni', to='seminar.Cislo', verbose_name='číslo pro body')),
],
options={
'verbose_name': 'Hodnocení',
'verbose_name_plural': 'Hodnocení',
'db_table': 'seminar_hodnoceni',
},
),
migrations.CreateModel(
name='Konfera',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('nazev', models.CharField(help_text='Název konfery', max_length=100, verbose_name='název konfery')),
('anotace', models.TextField(blank=True, help_text='Popis, o čem bude konfera.', verbose_name='anotace')),
('abstrakt', models.TextField(blank=True, help_text='Abstrakt konfery tak, jak byl uveden ve sborníku', verbose_name='abstrakt')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka ke konfeře(plain text)', verbose_name='neveřejná poznámka')),
('typ_prezentace', models.CharField(choices=[('veletrh', 'Veletrh (postery)'), ('prezentace', 'Prezentace (přednáška)')], default='veletrh', max_length=16, verbose_name='typ prezentace')),
('prezentace', models.FileField(blank=True, help_text='Prezentace nebo fotka posteru', upload_to=seminar.models.generate_filename_konfera, verbose_name='prezentace')),
('materialy', models.FileField(blank=True, help_text='Další materiály ke konfeře zabalené do jednoho souboru', upload_to=seminar.models.generate_filename_konfera, verbose_name='materialy')),
],
options={
'verbose_name': 'Konfera',
'verbose_name_plural': 'Konfery',
'db_table': 'seminar_konfera',
},
),
migrations.CreateModel(
name='Organizator',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('vytvoreno', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, verbose_name='Vytvořeno')),
('organizuje_od', models.DateTimeField(blank=True, null=True, verbose_name='Organizuje od')),
('organizuje_do', models.DateTimeField(blank=True, null=True, verbose_name='Organizuje do')),
('studuje', models.CharField(blank=True, help_text="Např. 'Studuje Obecnou fyziku (Bc.), 3. ročník', 'Vystudovala Diskrétní modely a algoritmy (Mgr.)' nebo 'Přednáší na MFF'", max_length=256, null=True, verbose_name='Studium aj.')),
('strucny_popis_organizatora', models.TextField(blank=True, null=True, verbose_name='Stručný popis organizátora')),
('skola', models.CharField(blank=True, help_text='Škola, např. MFF, VŠCHT, VUT, ... prostě aby se nemuselo psát do studuješkolu, ale jen obor, možnost zobrazit zvlášť', max_length=256, null=True, verbose_name='Škola, kterou studuje')),
],
options={
'verbose_name': 'Organizátor',
'verbose_name_plural': 'Organizátoři',
},
),
migrations.CreateModel(
name='Osoba',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('jmeno', models.CharField(max_length=256, verbose_name='jméno')),
('prijmeni', models.CharField(max_length=256, verbose_name='příjmení')),
('prezdivka', models.CharField(max_length=256, verbose_name='přezdívka')),
('pohlavi_muz', models.BooleanField(default=False, verbose_name='pohlaví (muž)')),
('email', models.EmailField(blank=True, default='', max_length=256, verbose_name='e-mail')),
('telefon', models.CharField(blank=True, default='', max_length=256, verbose_name='telefon')),
('datum_narozeni', models.DateField(blank=True, null=True, verbose_name='datum narození')),
('datum_souhlasu_udaje', models.DateField(blank=True, help_text='Datum souhlasu se zpracováním osobních údajů', null=True, verbose_name='datum souhlasu (údaje)')),
('datum_souhlasu_zasilani', models.DateField(blank=True, help_text='Datum souhlasu se zasíláním MFF materiálů', null=True, verbose_name='datum souhlasu (spam)')),
('datum_registrace', models.DateField(default=django.utils.timezone.now, verbose_name='datum registrace do semináře')),
('ulice', models.CharField(blank=True, default='', max_length=256, verbose_name='ulice')),
('mesto', models.CharField(blank=True, default='', max_length=256, verbose_name='město')),
('psc', models.CharField(blank=True, default='', max_length=32, verbose_name='PSČ')),
('stat', django_countries.fields.CountryField(default='CZ', help_text='ISO 3166-1 kód země velkými písmeny (CZ, SK, ...)', max_length=2, verbose_name='stát')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k osobě (plain text)', verbose_name='neveřejná poznámka')),
('foto', imagekit.models.fields.ProcessedImageField(blank=True, help_text='Vlož fotografii osoby o libovolné velikosti', null=True, upload_to='image_osoby/velke/%Y/', verbose_name='Fotografie osoby')),
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='uživatel')),
],
options={
'verbose_name': 'Osoba',
'verbose_name_plural': 'Osoby',
'db_table': 'seminar_osoby',
'ordering': ['prijmeni', 'jmeno'],
},
),
migrations.CreateModel(
name='Problem',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('nazev', models.CharField(max_length=256, verbose_name='název')),
('stav', models.CharField(choices=[('navrh', 'Návrh'), ('zadany', 'Zadaný'), ('vyreseny', 'Vyřešený'), ('smazany', 'Smazaný')], default='navrh', max_length=32, verbose_name='stav problému')),
('poznamka', models.TextField(blank=True, help_text='Neveřejný návrh úlohy, návrh řešení, text zadání, poznámky ...', verbose_name='org poznámky (HTML)')),
('kod', models.CharField(blank=True, default='', help_text='Číslo/kód úlohy v čísle nebo kód tématu/článku/seriálu v ročníku', max_length=32, verbose_name='lokální kód')),
('vytvoreno', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, verbose_name='vytvořeno')),
('autor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='autor_problemu_problem', to='seminar.Organizator', verbose_name='autor problému')),
('garant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='garant_problemu_problem', to='seminar.Organizator', verbose_name='garant zadaného problému')),
('nadproblem', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nadproblem_problem', to='seminar.Problem', verbose_name='nadřazený problém')),
('opravovatele', models.ManyToManyField(blank=True, related_name='opravovatele_problem', to='seminar.Organizator', verbose_name='opravovatelé')),
('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_seminar.problem_set+', to='contenttypes.ContentType')),
('zamereni', taggit.managers.TaggableManager(blank=True, help_text='Zaměření M/F/I/O problému, příp. další tagy', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='zaměření')),
],
options={
'verbose_name': 'Problém',
'verbose_name_plural': 'Problémy',
'db_table': 'seminar_problemy',
'ordering': ['nazev'],
},
),
migrations.CreateModel(
name='Reseni',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('cas_doruceni', models.DateTimeField(blank=True, default=django.utils.timezone.now, verbose_name='čas_doručení')),
('forma', models.CharField(choices=[('papir', 'Papírové řešení'), ('email', 'Emailem'), ('upload', 'Upload přes web')], default='email', max_length=16, verbose_name='forma řešení')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k řešení (plain text)', verbose_name='neveřejná poznámka')),
('zverejneno', models.BooleanField(default=False, help_text='Udává, zda je řešení zveřejněno', verbose_name='řešení zveřejněno')),
('problem', models.ManyToManyField(help_text='Problém', through='seminar.Hodnoceni', to='seminar.Problem', verbose_name='problém')),
],
options={
'verbose_name': 'Řešení',
'verbose_name_plural': 'Řešení',
'db_table': 'seminar_reseni',
'ordering': ['-cas_doruceni'],
},
),
migrations.CreateModel(
name='Resitel',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('rok_maturity', models.IntegerField(blank=True, null=True, verbose_name='rok maturity')),
('zasilat', models.CharField(choices=[('domu', 'Domů'), ('do_skoly', 'Do školy'), ('nikam', 'Nikam')], default='domu', max_length=32, verbose_name='kam zasílat')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k řešiteli (plain text)', verbose_name='neveřejná poznámka')),
('osoba', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Osoba', verbose_name='osoba')),
],
options={
'verbose_name': 'Řešitel',
'verbose_name_plural': 'Řešitelé',
'db_table': 'seminar_resitele',
'ordering': ['osoba'],
},
),
migrations.CreateModel(
name='Rocnik',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('prvni_rok', models.IntegerField(db_index=True, unique=True, verbose_name='první rok')),
('rocnik', models.IntegerField(db_index=True, unique=True, verbose_name='číslo ročníku')),
('exportovat', models.BooleanField(db_column='exportovat', default=False, help_text='Exportuje se jen podle tohoto flagu (ne veřejnosti), a to jen čísla s veřejnou výsledkovkou', verbose_name='export do AESOPa')),
],
options={
'verbose_name': 'Ročník',
'verbose_name_plural': 'Ročníky',
'db_table': 'seminar_rocniky',
'ordering': ['-rocnik'],
},
),
migrations.CreateModel(
name='Soustredeni',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('datum_zacatku', models.DateField(blank=True, help_text='První den soustředění', null=True, verbose_name='datum začátku')),
('datum_konce', models.DateField(blank=True, help_text='Poslední den soustředění', null=True, verbose_name='datum konce')),
('verejne_db', models.BooleanField(db_column='verejne', default=False, verbose_name='soustředění zveřejněno')),
('misto', models.CharField(blank=True, default='', help_text='Místo (název obce, volitelně též objektu', max_length=256, verbose_name='místo soustředění')),
('text', models.TextField(blank=True, default='', verbose_name='text k soustředění (HTML)')),
('typ', models.CharField(choices=[('jarni', 'Jarní soustředění'), ('podzimni', 'Podzimní soustředění'), ('vikend', 'Víkendový sraz')], default='podzimni', max_length=16, verbose_name='typ akce')),
('exportovat', models.BooleanField(db_column='exportovat', default=False, help_text='Exportuje se jen podle tohoto flagu (ne veřejnosti)', verbose_name='export do AESOPa')),
],
options={
'verbose_name': 'Soustředění',
'verbose_name_plural': 'Soustředění',
'db_table': 'seminar_soustredeni',
'ordering': ['-rocnik__rocnik', '-datum_zacatku'],
},
),
migrations.CreateModel(
name='Text',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('na_web', models.TextField(blank=True, help_text='Text ke zveřejnění na webu', verbose_name='text na web')),
('do_cisla', models.TextField(blank=True, help_text='Text ke zveřejnění v čísle', verbose_name='text do čísla')),
],
options={
'verbose_name': 'text',
'verbose_name_plural': 'texty',
'db_table': 'seminar_texty',
},
),
migrations.CreateModel(
name='TreeNode',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('first_child', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.TreeNode', verbose_name='první potomek')),
('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_seminar.treenode_set+', to='contenttypes.ContentType')),
('root', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='potomci_set', to='seminar.TreeNode', verbose_name='kořen stromu')),
('succ', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prev', to='seminar.TreeNode', verbose_name='další element na stejné úrovni')),
],
options={
'verbose_name': 'TreeNode',
'verbose_name_plural': 'TreeNody',
'db_table': 'seminar_nodes_treenode',
},
),
migrations.CreateModel(
name='Clanek',
fields=[
('problem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem')),
],
options={
'verbose_name': 'Článek',
'verbose_name_plural': 'Články',
'db_table': 'seminar_clanky',
},
bases=('seminar.problem',),
),
migrations.CreateModel(
name='MezicisloNode',
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')),
],
options={
'verbose_name': 'Mezičíslo (Node)',
'verbose_name_plural': 'Mezičísla (Node)',
'db_table': 'seminar_nodes_mezicislo',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='Tema',
fields=[
('problem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem')),
('tema_typ', models.CharField(choices=[('tema', 'Téma'), ('serial', 'Seriál')], default='tema', max_length=16, verbose_name='Typ tématu')),
('rocnik', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Rocnik', verbose_name='ročník')),
],
options={
'verbose_name': 'Téma',
'verbose_name_plural': 'Témata',
'db_table': 'seminar_temata',
},
bases=('seminar.problem',),
),
migrations.CreateModel(
name='Uloha',
fields=[
('problem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem')),
('max_body', models.DecimalField(blank=True, decimal_places=1, max_digits=8, null=True, verbose_name='maximum bodů')),
],
options={
'verbose_name': 'Úloha',
'verbose_name_plural': 'Úlohy',
'db_table': 'seminar_ulohy',
},
bases=('seminar.problem',),
),
migrations.CreateModel(
name='Soustredeni_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')),
('resitel', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Resitel', verbose_name='řešitel')),
('soustredeni', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Soustredeni', verbose_name='soustředění')),
],
options={
'verbose_name': 'Účast na soustředění',
'verbose_name_plural': 'Účasti na soustředění',
'db_table': 'seminar_soustredeni_ucastnici',
'ordering': ['soustredeni', 'resitel'],
},
),
migrations.CreateModel(
name='Soustredeni_Organizatori',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k účasti organizátora (plain text)', verbose_name='neveřejná poznámka')),
('organizator', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Organizator', verbose_name='organizátor')),
('soustredeni', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Soustredeni', verbose_name='soustředění')),
],
options={
'verbose_name': 'Účast organizátorů na soustředění',
'verbose_name_plural': 'Účasti organizátorů na soustředění',
'db_table': 'seminar_soustredeni_organizatori',
'ordering': ['soustredeni', 'organizator'],
},
),
migrations.AddField(
model_name='soustredeni',
name='organizatori',
field=models.ManyToManyField(help_text='Seznam organizátorů soustředění', through='seminar.Soustredeni_Organizatori', to='seminar.Organizator', verbose_name='Organizátoři soustředění'),
),
migrations.AddField(
model_name='soustredeni',
name='rocnik',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='soustredeni', to='seminar.Rocnik', verbose_name='ročník'),
),
migrations.AddField(
model_name='soustredeni',
name='ucastnici',
field=models.ManyToManyField(help_text='Seznam účastníků soustředění', through='seminar.Soustredeni_Ucastnici', to='seminar.Resitel', verbose_name='účastníci soustředění'),
),
migrations.CreateModel(
name='Skola',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('aesop_id', models.CharField(blank=True, default='', help_text='Aesopi ID typu "izo:..." nebo "aesop:..."', max_length=32, verbose_name='Aesop ID')),
('izo', models.CharField(blank=True, help_text='IZO školy (jen české školy)', max_length=32, verbose_name='IZO')),
('nazev', models.CharField(help_text='Celý název školy', max_length=256, verbose_name='název')),
('kratky_nazev', models.CharField(blank=True, help_text='Zkrácený název pro zobrazení ve výsledkovce', max_length=256, verbose_name='zkrácený název')),
('ulice', models.CharField(max_length=256, verbose_name='ulice')),
('mesto', models.CharField(max_length=256, verbose_name='město')),
('psc', models.CharField(max_length=32, verbose_name='PSČ')),
('stat', django_countries.fields.CountryField(default='CZ', help_text='ISO 3166-1 kód země velkými písmeny (CZ, SK, ...)', max_length=2, verbose_name='stát')),
('je_zs', models.BooleanField(default=True, verbose_name='základní stupeň')),
('je_ss', models.BooleanField(default=True, verbose_name='střední stupeň')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka ke škole (plain text)', verbose_name='neveřejná poznámka')),
('kontaktni_osoba', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Osoba', verbose_name='Kontaktní osoba')),
],
options={
'verbose_name': 'Škola',
'verbose_name_plural': 'Školy',
'db_table': 'seminar_skoly',
'ordering': ['mesto', 'nazev'],
},
),
migrations.AddField(
model_name='resitel',
name='skola',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Skola', verbose_name='škola'),
),
migrations.CreateModel(
name='Reseni_Resitele',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('reseni', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Reseni', verbose_name='řešení')),
('resitele', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Resitel', verbose_name='řešitel')),
],
options={
'verbose_name': 'Řešení řešitelů',
'verbose_name_plural': 'Řešení řešitelů',
'db_table': 'seminar_reseni_resitele',
'ordering': ['reseni', 'resitele'],
},
),
migrations.AddField(
model_name='reseni',
name='resitele',
field=models.ManyToManyField(help_text='Seznam autorů řešení', through='seminar.Reseni_Resitele', to='seminar.Resitel', verbose_name='autoři řešení'),
),
migrations.AddField(
model_name='reseni',
name='text_cely',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reseni_cely_set', to='seminar.Text', verbose_name='Plná verze textu řešení'),
),
migrations.AddField(
model_name='reseni',
name='text_zkraceny',
field=models.ManyToManyField(help_text='Seznam úryvků z řešení', related_name='reseni_zkraceny_set', to='seminar.Text', verbose_name='zkrácené verze řešení'),
),
migrations.CreateModel(
name='PrilohaReseni',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('vytvoreno', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, verbose_name='vytvořeno')),
('soubor', models.FileField(upload_to=seminar.models.generate_filename, verbose_name='soubor')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k příloze řešení (plain text), např. o původu', verbose_name='neveřejná poznámka')),
('reseni', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prilohy', to='seminar.Reseni', verbose_name='řešení')),
],
options={
'verbose_name': 'Příloha řešení',
'verbose_name_plural': 'Přílohy řešení',
'db_table': 'seminar_priloha_reseni',
'ordering': ['reseni', 'vytvoreno'],
},
),
migrations.CreateModel(
name='Prijemce',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k příemci čísel (plain text)', verbose_name='neveřejná poznámka')),
('osoba', models.OneToOneField(help_text='Které osobě či na jakou adresu se mají zasílat čísla', on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='komu')),
],
options={
'verbose_name': 'příjemce',
'verbose_name_plural': 'příjemce',
'db_table': 'seminar_prijemce',
},
),
migrations.CreateModel(
name='Pohadka',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('vytvoreno', models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, verbose_name='Vytvořeno')),
('autor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Organizator', verbose_name='Autor pohádky')),
],
options={
'verbose_name': 'Pohádka',
'verbose_name_plural': 'Pohádky',
'db_table': 'seminar_pohadky',
'ordering': ['vytvoreno'],
},
),
migrations.AddField(
model_name='organizator',
name='osoba',
field=models.OneToOneField(help_text='osobní údaje organizátora', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='org', to='seminar.Osoba', verbose_name='osoba'),
),
migrations.CreateModel(
name='Obrazek',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('na_web', models.ImageField(blank=True, null=True, upload_to='obrazky/%Y/%m/%d/', verbose_name='obrázek na web')),
('do_cisla_barevny', models.FileField(blank=True, help_text='Barevná verze obrázku do čísla', null=True, upload_to='obrazky/%Y/%m/%d/', verbose_name='barevný obrázek do čísla')),
('do_cisla_cernobily', models.FileField(blank=True, help_text='Černobílá verze obrázku do čísla', null=True, upload_to='obrazky/%Y/%m/%d/', verbose_name='černobílý obrázek do čísla')),
('text', models.ForeignKey(help_text='text, ve kterém se obrázek vyskytuje', on_delete=django.db.models.deletion.CASCADE, to='seminar.Text', verbose_name='text')),
],
options={
'verbose_name': 'obrázek',
'verbose_name_plural': 'obrázky',
'db_table': 'seminar_obrazky',
},
),
migrations.CreateModel(
name='Novinky',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('datum', models.DateField(auto_now_add=True)),
('text', models.TextField(blank=True, null=True, verbose_name='Text novinky')),
('obrazek', models.ImageField(blank=True, null=True, upload_to='image_novinky/%Y/%m/%d/', verbose_name='Obrázek')),
('zverejneno', models.BooleanField(default=False, verbose_name='Zveřejněno')),
('autor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Organizator', verbose_name='Autor novinky')),
],
options={
'verbose_name': 'Novinka',
'verbose_name_plural': 'Novinky',
'ordering': ['-datum'],
},
),
migrations.CreateModel(
name='Nastaveni',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('aktualni_cislo', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Cislo', verbose_name='poslední vydané číslo')),
('aktualni_rocnik', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Rocnik', verbose_name='aktuální ročník')),
],
options={
'verbose_name': 'Nastavení semináře',
'db_table': 'seminar_nastaveni',
},
),
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='organizator',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='konfery', to='seminar.Organizator', verbose_name='organizátor'),
),
migrations.AddField(
model_name='konfera',
name='reseni',
field=models.OneToOneField(blank=True, help_text='Účastnický přípěvek o konfeře', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='konfery', to='seminar.Reseni', verbose_name='článek ke konfeře'),
),
migrations.AddField(
model_name='konfera',
name='soustredeni',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='konfery', to='seminar.Soustredeni', verbose_name='soustředění'),
),
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'),
),
migrations.AddField(
model_name='hodnoceni',
name='problem',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Problem', verbose_name='problém'),
),
migrations.AddField(
model_name='hodnoceni',
name='reseni',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Reseni', verbose_name='řešení'),
),
migrations.AddField(
model_name='cislo',
name='rocnik',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cisla', to='seminar.Rocnik', verbose_name='ročník'),
),
migrations.CreateModel(
name='UlohaZadaniNode',
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')),
('uloha', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Uloha', verbose_name='úloha')),
],
options={
'verbose_name': 'Zadání úlohy (Node)',
'verbose_name_plural': 'Zadání úloh (Node)',
'db_table': 'seminar_nodes_uloha_zadani',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='UlohaVzorakNode',
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')),
('uloha', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Uloha', verbose_name='úloha')),
],
options={
'verbose_name': 'Vzorák úlohy (Node)',
'verbose_name_plural': 'Vzoráky úloh (Node)',
'db_table': 'seminar_nodes_uloha_vzorak',
},
bases=('seminar.treenode',),
),
migrations.AddField(
model_name='uloha',
name='cislo_deadline',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='deadlinove_ulohy', to='seminar.Cislo', verbose_name='číslo deadlinu'),
),
migrations.AddField(
model_name='uloha',
name='cislo_reseni',
field=models.ForeignKey(blank=True, help_text='Číslo s řešením úlohy, jen pro úlohy', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='resene_ulohy', to='seminar.Cislo', verbose_name='číslo řešení'),
),
migrations.AddField(
model_name='uloha',
name='cislo_zadani',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='zadane_ulohy', to='seminar.Cislo', verbose_name='číslo zadání'),
),
migrations.CreateModel(
name='TextNode',
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')),
('text', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Text', verbose_name='text')),
],
options={
'verbose_name': 'Text (Node)',
'verbose_name_plural': 'Text (Node)',
'db_table': 'seminar_nodes_obsah',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='TemaVCisleNode',
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')),
('tema', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Tema', verbose_name='téma v čísle')),
],
options={
'verbose_name': 'Téma v čísle (Node)',
'verbose_name_plural': 'Témata v čísle (Node)',
'db_table': 'seminar_nodes_temavcisle',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='RocnikNode',
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')),
('rocnik', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Rocnik', verbose_name='ročník')),
],
options={
'verbose_name': 'Ročník (Node)',
'verbose_name_plural': 'Ročníky (Node)',
'db_table': 'seminar_nodes_rocnik',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='PohadkaNode',
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')),
('pohadka', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Pohadka', verbose_name='pohádka')),
],
options={
'verbose_name': 'Pohádka (Node)',
'verbose_name_plural': 'Pohádky (Node)',
'db_table': 'seminar_nodes_pohadka',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='KonferaNode',
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')),
('konfera', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Konfera', verbose_name='konfera')),
],
options={
'verbose_name': 'Konfera (Node)',
'verbose_name_plural': 'Konfery (Node)',
'db_table': 'seminar_nodes_konfera',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='ClanekNode',
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')),
('clanek', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Clanek', verbose_name='článek')),
],
options={
'verbose_name': 'Článek (Node)',
'verbose_name_plural': 'Články (Node)',
'db_table': 'seminar_nodes_clanek',
},
bases=('seminar.treenode',),
),
migrations.AddField(
model_name='clanek',
name='cislo',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Cislo', verbose_name='číslo'),
),
migrations.CreateModel(
name='CisloNode',
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')),
('cislo', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Cislo', verbose_name='číslo')),
],
options={
'verbose_name': 'Číslo (Node)',
'verbose_name_plural': 'Čísla (Node)',
'db_table': 'seminar_nodes_cislo',
},
bases=('seminar.treenode',),
),
]

2164
seminar/migrations/0001_squashed_0067_auto_20190814_0805.py

File diff suppressed because it is too large

48
seminar/migrations/0002_add_body_views.py

@ -0,0 +1,48 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
import seminar.models
import django.utils.timezone
from django.conf import settings
CREATE_VIEWS="""
create view seminar_body_za_cislo as
select
sr.cislo_body_id || '-' || sr.resitel_id as id,
sr.cislo_body_id as cislo_id,
sr.resitel_id as resitel_id,
sum(sr.body) as body
from seminar_reseni as sr
group by sr.cislo_body_id, sr.resitel_id
order by body desc;
create view seminar_body_k_cislu as
select
akt_c.id || '-' || min_bzc.resitel_id as id,
akt_c.id as cislo_id,
min_bzc.resitel_id as resitel_id,
max(akt_bzc.body) as body,
sum(min_bzc.body) as body_celkem
from ((seminar_cisla as akt_c
inner join seminar_cisla as min_c on min_c.rocnik_id = akt_c.rocnik_id and akt_c.cislo >= min_c.cislo)
inner join seminar_body_za_cislo as min_bzc on min_c.id = min_bzc.cislo_id)
left outer join seminar_body_za_cislo as akt_bzc on akt_bzc.cislo_id = akt_c.id and akt_bzc.resitel_id = min_bzc.resitel_id
group by akt_c.id, min_bzc.resitel_id, akt_bzc.resitel_id
order by body_celkem desc;
"""
DROP_VIEWS="""
drop view seminar_body_k_cislu;
drop view seminar_body_za_cislo;
"""
class Migration(migrations.Migration):
dependencies = [("seminar", "0001_initial")]
operations = [
migrations.RunSQL(sql=CREATE_VIEWS, reverse_sql=DROP_VIEWS)
]

32
seminar/migrations/0003_add_skola_zs_ss.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0002_add_body_views'),
]
operations = [
migrations.AddField(
model_name='skola',
name='je_ss',
field=models.BooleanField(default=True, verbose_name='st\u0159edn\xed stupe\u0148'),
preserve_default=False,
),
migrations.AddField(
model_name='skola',
name='je_zs',
field=models.BooleanField(default=True, verbose_name='z\xe1kladn\xed stupe\u0148'),
preserve_default=False,
),
migrations.AlterField(
model_name='reseni',
name='poznamka',
field=models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \u0159e\u0161en\xed (plain text, editace v detailu \u0159e\u0161en\xed)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True),
preserve_default=True,
),
]

44
seminar/migrations/0004_add_old_dakos_id.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0003_add_skola_zs_ss'),
]
operations = [
migrations.AddField(
model_name='problem',
name='dakos_id',
field=models.CharField(default=b'', help_text='DaKoS ID z exportu, s prefixem podle p\u016fvodu: "AZAD:xxx" (z MM_AZAD), "DOZ:xxx" (z MM_DOZ), "ZAD:xxx" (z MM_ZADANIA)', max_length=32, verbose_name='Star\xe9 DaKoS ID', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='resitel',
name='dakos_id',
field=models.CharField(default=b'', help_text='DaKoS ID z exportu, jen historick\xfd v\xfdznam, podle tabulky mamoper.MM_RIESITELIA', max_length=32, verbose_name='Stare DaKoS ID', blank=True),
preserve_default=True,
),
migrations.AddField(
model_name='skola',
name='dakos_id',
field=models.CharField(default=b'', help_text='DaKoS ID z exportu, jen historick\xfd v\xfdznam, podle tabulky dksroot.V_skola', max_length=32, verbose_name='Stare DaKoS ID', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='skola',
name='je_ss',
field=models.BooleanField(default=True, verbose_name='st\u0159edn\xed stupe\u0148'),
preserve_default=True,
),
migrations.AlterField(
model_name='skola',
name='je_zs',
field=models.BooleanField(default=True, verbose_name='z\xe1kladn\xed stupe\u0148'),
preserve_default=True,
),
]

21
seminar/migrations/0005_alter_problem_autor.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('seminar', '0004_add_old_dakos_id'),
]
operations = [
migrations.AlterField(
model_name='problem',
name='autor',
field=models.ForeignKey(related_name='autor_uloh', verbose_name='autor probl\xe9mu', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
preserve_default=True,
),
]

28
seminar/migrations/0006_problem_add_timestamp.py

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('seminar', '0005_alter_problem_autor'),
]
operations = [
migrations.AddField(
model_name='problem',
name='timestamp',
field=models.DateTimeField(default=datetime.datetime(2015, 5, 15, 8, 54, 56, 319985, tzinfo=utc), verbose_name='vytvo\u0159eno', auto_now=True),
preserve_default=False,
),
migrations.AlterField(
model_name='problem',
name='dakos_id',
field=models.CharField(default=b'', help_text='DaKoS ID z exportu, s prefixem podle p\u016fvodu: "AZAD:xxx (z MM_AZAD), ""DOZ:xxx" (z MM_DOZ), "ZAD:rocnik.cislo.uloha.typ" (z MM_ZADANIA)', max_length=32, verbose_name='Star\xe9 DaKoS ID', blank=True),
preserve_default=True,
),
]

22
seminar/migrations/0007_problem_zamereni.py

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0001_initial'),
('seminar', '0006_problem_add_timestamp'),
]
operations = [
migrations.AddField(
model_name='problem',
name='zamereni',
field=taggit.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text=b'Zam\xc4\x9b\xc5\x99en\xc3\xad M/F/I/O probl\xc3\xa9mu, p\xc5\x99\xc3\xadp. dal\xc5\xa1\xc3\xad tagy', verbose_name='zam\u011b\u0159en\xed'),
preserve_default=True,
),
]

20
seminar/migrations/0008_reseni_forma.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0007_problem_zamereni'),
]
operations = [
migrations.AddField(
model_name='reseni',
name='forma',
field=models.CharField(default=b'papir', max_length=16, verbose_name='forma \u0159e\u0161en\xed', choices=[(b'papir', 'Pap\xedrov\xe9 \u0159e\u0161en\xed'), (b'email', 'Emailem'), (b'upload', 'Upload p\u0159es web')]),
preserve_default=True,
),
]

47
seminar/migrations/0009_rename_imported_IDs.py

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0008_reseni_forma'),
]
operations = [
migrations.RenameField(
model_name='problem',
old_name='dakos_id',
new_name='import_dakos_id',
),
migrations.RenameField(
model_name='resitel',
old_name='dakos_id',
new_name='import_mamoper_id',
),
migrations.RenameField(
model_name='skola',
old_name='dakos_id',
new_name='import_dakos_id',
),
migrations.AlterField(
model_name='problem',
name='import_dakos_id',
field=models.CharField(default=b'', help_text='ID z importu z DAKOSU s prefixem podle p\u016fvodu: "AZAD:xxx (MAMOPER.MM_AZAD), ""DOZ:xxx" (MAMOPER.MM_DOZ), "ZAD:rocnik.cislo.uloha.typ" (MAMOPER.MM_ZADANIA)', max_length=32, verbose_name='importovan\xe9 ID s typem', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='resitel',
name='import_mamoper_id',
field=models.CharField(default=b'', help_text='MAMOPER.MM_RIESITELIA.ID z DAKOS importu, jen historick\xfd v\xfdznam', max_length=32, verbose_name='importovan\xe9 MM_RIESITELIA.ID', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='skola',
name='import_dakos_id',
field=models.CharField(default=b'', help_text='DKSROOT.V_SKOLA.ID z DAKOS importu, jen historick\xfd v\xfdznam', max_length=32, verbose_name='importovan\xe9 DKSROOT.V_SKOLA.ID', blank=True),
preserve_default=True,
),
]

20
seminar/migrations/0010_alter_rok_maturity.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0009_rename_imported_IDs'),
]
operations = [
migrations.AlterField(
model_name='resitel',
name='rok_maturity',
field=models.IntegerField(null=True, verbose_name='rok maturity', blank=True),
preserve_default=True,
),
]

39
seminar/migrations/0011_alter_timestamp_def.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('seminar', '0010_alter_rok_maturity'),
]
operations = [
migrations.AlterField(
model_name='prilohareseni',
name='timestamp',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='vytvo\u0159eno', editable=False, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='problem',
name='import_dakos_id',
field=models.CharField(default=b'', help_text='ID z importu z DAKOSU s prefixem podle p\u016fvodu: "AZAD:xxx (MAMOPER.MM_AZAD), ""DOZ:xxx" (MAMOPER.MM_DOZ), "ZAD:rocnik.cislo.uloha.typ" (MAMOPER.MM_ZADANIA), "ULOHA:xxx" (MAMOPER.MM_ULOHY)', max_length=32, verbose_name='importovan\xe9 ID s typem', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='problem',
name='timestamp',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='vytvo\u0159eno', editable=False, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='reseni',
name='timestamp',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='vytvo\u0159eno', editable=False, blank=True),
preserve_default=True,
),
]

18
seminar/migrations/0012_remove_soustredeni_ucastnici.py

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0011_alter_timestamp_def'),
]
operations = [
migrations.RemoveField(
model_name='soustredeni',
name='ucastnici',
),
]

36
seminar/migrations/0013_soustredeni_ucastnici_through_model.py

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0012_remove_soustredeni_ucastnici'),
]
operations = [
migrations.CreateModel(
name='Soustredeni_Ucastnici',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('poznamka', models.CharField(default=b'', help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \xfa\u010dasti (plain text)', max_length=64, verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
('resitel', models.ForeignKey(verbose_name='\u0159e\u0161itel', to='seminar.Resitel', on_delete=models.CASCADE)),
('soustredeni', models.ForeignKey(verbose_name='soust\u0159ed\u011bn\xed', to='seminar.Soustredeni',on_delete=models.CASCADE)),
],
options={
'ordering': ['soustredeni', 'resitel'],
'db_table': 'seminar_soustredeni_ucastnici',
'verbose_name': '\xda\u010dast na soust\u0159ed\u011bn\xed',
'verbose_name_plural': '\xda\u010dasti na soust\u0159ed\u011bn\xed',
},
bases=(models.Model,),
),
migrations.AddField(
model_name='soustredeni',
name='ucastnici',
field=models.ManyToManyField(help_text='Seznam \xfa\u010dastn\xedk\u016f soust\u0159ed\u011bn\xed', to='seminar.Resitel', verbose_name='\xfa\u010dastn\xedci soust\u0159ed\u011bn\xed', through='seminar.Soustredeni_Ucastnici'),
preserve_default=True,
),
]

50
seminar/migrations/0014_uprava_poznamek.py

@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0013_soustredeni_ucastnici_through_model'),
]
operations = [
migrations.AlterModelOptions(
name='problem',
options={'ordering': ['nazev'], 'verbose_name': 'Probl\xe9m', 'verbose_name_plural': 'Probl\xe9my'},
),
migrations.AlterModelOptions(
name='reseni',
options={'ordering': ['problem_id', 'resitel_id'], 'verbose_name': '\u0158e\u0161en\xed', 'verbose_name_plural': '\u0158e\u0161en\xed'},
),
migrations.AlterModelOptions(
name='skola',
options={'ordering': ['mesto', 'nazev'], 'verbose_name': '\u0160kola', 'verbose_name_plural': '\u0160koly'},
),
migrations.AddField(
model_name='cislo',
name='poznamka',
field=models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \u010d\xedslu (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='problem',
name='text_problemu_org',
field=models.TextField(verbose_name='neve\u0159ejn\xe9 zad\xe1n\xed a organiz\xe1torsk\xe9 a pozn\xe1mky', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='reseni',
name='poznamka',
field=models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \u0159e\u0161en\xed (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='soustredeni_ucastnici',
name='poznamka',
field=models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \xfa\u010dasti (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True),
preserve_default=True,
),
]

20
seminar/migrations/0015_soustredeni_text.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0014_uprava_poznamek'),
]
operations = [
migrations.AddField(
model_name='soustredeni',
name='text',
field=models.TextField(default=b'', verbose_name='text k soust\u0159ed\u011bn\xed (HTML)', blank=True),
preserve_default=True,
),
]

42
seminar/migrations/0016_texty_problemu.py

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0015_soustredeni_text'),
]
operations = [
migrations.RenameField(
model_name='problem',
old_name='text_problemu_org',
new_name='text_org',
),
migrations.RenameField(
model_name='problem',
old_name='text_problemu',
new_name='text_zadani',
),
migrations.AddField(
model_name='problem',
name='text_reseni',
field=models.TextField(help_text='Ve\u0159ejn\xfd text \u0159e\u0161en\xed (HTML, u t\xe9mat i p\u0159\xedsp\u011bvky a koment\xe1\u0159e)', verbose_name='ve\u0159ejn\xe9 \u0159e\u0161en\xed (HTML)', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='problem',
name='text_org',
field=models.TextField(help_text='Neve\u0159ejn\xfd n\xe1vrh \xfalohy, n\xe1vrh \u0159e\u0161en\xed, text zad\xe1n\xed, pozn\xe1mky ...', verbose_name='org pozn\xe1mky (HTML)', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='problem',
name='text_zadani',
field=models.TextField(help_text='Ve\u0159ejn\xfd text zad\xe1n\xed (HTML)', verbose_name='ve\u0159ejn\xe9 zad\xe1n\xed (HTML)', blank=True),
preserve_default=True,
),
]

20
seminar/migrations/0017_texty_problemu_minor.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0016_texty_problemu'),
]
operations = [
migrations.AlterField(
model_name='problem',
name='text_reseni',
field=models.TextField(help_text='Ve\u0159ejn\xfd text \u0159e\u0161en\xed (HTML, u t\xe9mat i p\u0159\xedsp\u011bvky a koment\xe1\u0159e)', verbose_name='ve\u0159ejn\xe9 \u0159e\u0161en\xed (HTML)', blank=True),
preserve_default=True,
),
]

36
seminar/migrations/0018_problemnavrh_problemzadany.py

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0017_texty_problemu_minor'),
]
operations = [
migrations.CreateModel(
name='ProblemNavrh',
fields=[
],
options={
'verbose_name': 'Probl\xe9m (n\xe1vrh)',
'proxy': True,
'verbose_name_plural': 'Probl\xe9my (n\xe1vrhy)',
},
bases=('seminar.problem',),
),
migrations.CreateModel(
name='ProblemZadany',
fields=[
],
options={
'verbose_name': 'Probl\xe9m (zadan\xfd)',
'proxy': True,
'verbose_name_plural': 'Probl\xe9my (zadan\xe9)',
},
bases=('seminar.problem',),
),
]

32
seminar/migrations/0019_rocnik_ciselne.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0018_problemnavrh_problemzadany'),
]
operations = [
migrations.AddField(
model_name='rocnik',
name='rocnik_n',
field=models.IntegerField(default=0, verbose_name='\u010d\xedslo ro\u010dn\xedku'),
preserve_default=False,
),
migrations.RunSQL(
sql="update seminar_rocniky set rocnik_n = cast (rocnik as integer)"
),
migrations.RemoveField(
model_name='rocnik',
name='rocnik',
),
migrations.RenameField(
model_name='rocnik',
old_name='rocnik_n',
new_name='rocnik',
),
]

44
seminar/migrations/0020_indexy_a_razeni.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0019_rocnik_ciselne'),
]
operations = [
migrations.AlterModelOptions(
name='cislo',
options={'ordering': ['-rocnik__rocnik', '-cislo'], 'verbose_name': '\u010c\xedslo', 'verbose_name_plural': '\u010c\xedsla'},
),
migrations.AlterModelOptions(
name='reseni',
options={'ordering': ['problem_id', 'resitel__prijmeni', 'resitel__jmeno'], 'verbose_name': '\u0158e\u0161en\xed', 'verbose_name_plural': '\u0158e\u0161en\xed'},
),
migrations.AlterModelOptions(
name='rocnik',
options={'ordering': ['-rocnik'], 'verbose_name': 'Ro\u010dn\xedk', 'verbose_name_plural': 'Ro\u010dn\xedky'},
),
migrations.AlterField(
model_name='cislo',
name='cislo',
field=models.CharField(help_text='V\u011bt\u0161inou jen "1", vyj\xedme\u010dn\u011b "7-8", lexikograficky ur\u010dije po\u0159ad\xed v ro\u010dn\xedku!', max_length=32, verbose_name='n\xe1zev \u010d\xedsla', db_index=True),
preserve_default=True,
),
migrations.AlterField(
model_name='rocnik',
name='prvni_rok',
field=models.IntegerField(unique=True, verbose_name='prvn\xed rok', db_index=True),
preserve_default=True,
),
migrations.AlterField(
model_name='rocnik',
name='rocnik',
field=models.IntegerField(unique=True, verbose_name='\u010d\xedslo ro\u010dn\xedku', db_index=True),
preserve_default=True,
),
]

20
seminar/migrations/0021_cislo_verejna_vysledkovka.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0020_indexy_a_razeni'),
]
operations = [
migrations.AddField(
model_name='cislo',
name='verejna_vysledkovka',
field=models.BooleanField(default=False, help_text='Je-li false u ve\u0159ejn\xe9ho \u010d\xedsla, nen\xed v\xfdsledkovka zat\xedm ve\u0159ejn\xe1.', verbose_name='zve\u0159ejn\u011bna v\xfdsledkovka'),
preserve_default=True,
),
]

29
seminar/migrations/0022_decimal_body.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import importlib
from django.db import models, migrations
migration_0022 = importlib.import_module('seminar.migrations.0002_add_body_views')
class Migration(migrations.Migration):
dependencies = [
('seminar', '0021_cislo_verejna_vysledkovka'),
]
operations = [
migrations.RunSQL(migration_0022.DROP_VIEWS),
migrations.AlterField(
model_name='problem',
name='body',
field=models.DecimalField(null=True, verbose_name='maximum bod\u016f', max_digits=8, decimal_places=1, blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='reseni',
name='body',
field=models.DecimalField(null=True, verbose_name='body', max_digits=8, decimal_places=1, blank=True),
preserve_default=True,
),
migrations.RunSQL(migration_0022.CREATE_VIEWS),
]

32
seminar/migrations/0023_add_novinky.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('seminar', '0022_decimal_body'),
]
operations = [
migrations.CreateModel(
name='Novinky',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('datum', models.DateField(auto_now_add=True)),
('text', models.TextField(null=True, verbose_name=b'Text novinky', blank=True)),
('obrazek', models.ImageField(upload_to=b'image_novinky/%Y/%m/%d/', null=True, verbose_name=b'Obr\xc3\xa1zek', blank=True)),
('zverejneno', models.BooleanField(default=False, verbose_name=b'Zve\xc5\x99ejn\xc4\x9bno')),
('autor', models.ForeignKey(verbose_name=b'Autor novinky', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE))
],
options={
'verbose_name': 'Novinka',
'verbose_name_plural': 'Novinky',
},
bases=(models.Model,),
),
]

35
seminar/migrations/0024_add_organizator.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('seminar', '0023_add_novinky'),
]
operations = [
migrations.CreateModel(
name='Organizator',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('prezdivka', models.CharField(max_length=32, null=True, verbose_name=b'P\xc5\x99ezd\xc3\xadvka', blank=True)),
('organizuje_od_roku', models.IntegerField(null=True, verbose_name=b'Organizuje od roku', blank=True)),
('organizuje_do_roku', models.IntegerField(null=True, verbose_name=b'Organizuje do roku', blank=True)),
('studuje', models.CharField(max_length=256, null=True, verbose_name=b'Studuje', blank=True)),
('strucny_popis_organizatora', models.TextField(null=True, verbose_name=b'Stru\xc4\x8dn\xc3\xbd popis organiz\xc3\xa1tora', blank=True)),
('foto', models.ImageField(help_text=b'Vlo\xc5\xbe fotografii organiz\xc3\xa1tora o libovon\xc3\xa9 velikosti', upload_to=b'image_organizatori/%Y/', null=True, verbose_name=b'Fotografie organiz\xc3\xa1tora', blank=True)),
('foto_male', models.ImageField(upload_to=b'image_organizatori/male/%Y/', null=True, editable=False, blank=True)),
('user', models.OneToOneField(verbose_name=b'Osoba', to=settings.AUTH_USER_MODEL, help_text=b'Vyber \xc3\xba\xc4\x8det sp\xc5\x99a\xc5\xbeen\xc3\xbd s organiz\xc3\xa1torem.',on_delete=models.CASCADE)),
],
options={
'verbose_name': 'Organiz\xe1tor',
'verbose_name_plural': 'Organiz\xe1to\u0159i',
},
bases=(models.Model,),
),
]

20
seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0024_add_organizator'),
]
operations = [
migrations.AlterField(
model_name='organizator',
name='foto',
field=models.ImageField(help_text=b'Vlo\xc5\xbe fotografii organiz\xc3\xa1tora o libovon\xc3\xa9 velikosti', upload_to=b'image_organizatori/velke/%Y/', null=True, verbose_name=b'Fotografie organiz\xc3\xa1tora', blank=True),
preserve_default=True,
),
]

20
seminar/migrations/0026_soustredeni_typ.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0025_zmena_cesty_nahravani_obrazku'),
]
operations = [
migrations.AddField(
model_name='soustredeni',
name='typ',
field=models.CharField(default=b'podzimni', max_length=16, verbose_name='typ akce', choices=[(b'jarni', 'Jarn\xed soust\u0159ed\u011bn\xed'), (b'podzimni', 'Podzimn\xed soust\u0159ed\u011bn\xed'), (b'sraz', 'Nepravideln\xfd sraz')]),
preserve_default=True,
),
]

32
seminar/migrations/0027_export_flag_a_typ_akce.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0026_soustredeni_typ'),
]
operations = [
migrations.AddField(
model_name='rocnik',
name='exportovat',
field=models.BooleanField(default=False, help_text='Exportuje se jen podle tohoto flagu (ne ve\u0159ejnosti), a to jen \u010d\xedsla s ve\u0159ejnou v\xfdsledkovkou', verbose_name='export do AESOPa', db_column='exportovat'),
preserve_default=True,
),
migrations.AddField(
model_name='soustredeni',
name='exportovat',
field=models.BooleanField(default=False, help_text='Exportuje se jen podle tohoto flagu (ne ve\u0159ejnosti)', verbose_name='export do AESOPa', db_column='exportovat'),
preserve_default=True,
),
migrations.AlterField(
model_name='soustredeni',
name='typ',
field=models.CharField(default=b'podzimni', max_length=16, verbose_name='typ akce', choices=[(b'jarni', 'Jarn\xed soust\u0159ed\u011bn\xed'), (b'podzimni', 'Podzimn\xed soust\u0159ed\u011bn\xed'), (b'vikend', 'V\xedkendov\xfd sraz')]),
preserve_default=True,
),
]

75
seminar/migrations/0028_add_body_celkem_views.py

@ -0,0 +1,75 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
import seminar.models
import django.utils.timezone
from django.conf import settings
CREATE_VIEWS="""
drop view seminar_body_k_cislu;
drop view seminar_body_za_cislo;
create view seminar_body_za_cislo as
select
seminar_reseni.cislo_body_id || '-' || seminar_reseni.resitel_id as id,
seminar_reseni.cislo_body_id as cislo_id,
seminar_reseni.resitel_id as resitel_id,
seminar_cisla.cislo as cislo,
seminar_cisla.rocnik_id as rocnik_id,
seminar_rocniky.rocnik as rocnik,
seminar_cisla.verejna_vysledkovka as verejna_vysledkovka,
sum(seminar_reseni.body) as body
from
seminar_reseni
inner join seminar_cisla on seminar_reseni.cislo_body_id = seminar_cisla.id
inner join seminar_rocniky on seminar_cisla.rocnik_id = seminar_rocniky.id
group by seminar_reseni.cislo_body_id, seminar_reseni.resitel_id, seminar_cisla.cislo,
seminar_cisla.rocnik_id, seminar_rocniky.rocnik, seminar_cisla.verejna_vysledkovka
order by body desc;
create view seminar_body_k_cislu_rocnik as
select
akt_body.id as id,
akt_body.cislo_id as cislo_id,
akt_body.resitel_id as resitel_id,
akt_body.body as body,
sum(min_body.body) as body_celkem
from
seminar_body_za_cislo as akt_body
inner join seminar_body_za_cislo as min_body on
(akt_body.resitel_id = min_body.resitel_id and
(akt_body.rocnik = min_body.rocnik and akt_body.cislo >= min_body.cislo)
)
group by akt_body.id, akt_body.cislo_id, akt_body.resitel_id, akt_body.body
order by body_celkem desc;
create view seminar_body_k_cislu_odjakziva as
select
akt_body.id as id,
akt_body.cislo_id as cislo_id,
akt_body.resitel_id as resitel_id,
akt_body.body as body,
sum(min_body.body) as body_celkem
from
seminar_body_za_cislo as akt_body
inner join seminar_body_za_cislo as min_body on
(akt_body.resitel_id = min_body.resitel_id and
((akt_body.rocnik = min_body.rocnik and akt_body.cislo >= min_body.cislo) or
(akt_body.rocnik < min_body.rocnik)
)
)
group by akt_body.id, akt_body.cislo_id, akt_body.resitel_id, akt_body.body
order by body_celkem desc;
"""
class Migration(migrations.Migration):
dependencies = [("seminar", "0027_export_flag_a_typ_akce")]
operations = [
migrations.RunSQL(sql=CREATE_VIEWS)
]

51
seminar/migrations/0029_fix_body_celkem_views.py

@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
import seminar.models
import django.utils.timezone
from django.conf import settings
CREATE_VIEWS="""
drop view seminar_body_k_cislu_rocnik;
create view seminar_body_k_cislu_rocnik as
select
seminar_cisla.id || '-' || min_body.resitel_id as id,
seminar_cisla.id as cislo_id,
min_body.resitel_id as resitel_id,
sum(min_body.body) as body
from
seminar_cisla
inner join seminar_body_za_cislo as min_body on
(min_body.rocnik_id = seminar_cisla.rocnik_id and seminar_cisla.cislo >= min_body.cislo)
group by seminar_cisla.id, min_body.resitel_id
order by body desc;
drop view seminar_body_k_cislu_odjakziva;
create view seminar_body_k_cislu_odjakziva as
select
seminar_cisla.id || '-' || min_body.resitel_id as id,
seminar_cisla.id as cislo_id,
min_body.resitel_id as resitel_id,
sum(min_body.body) as body
from
seminar_cisla
inner join seminar_rocniky on
(seminar_cisla.rocnik_id = seminar_rocniky.id)
inner join seminar_body_za_cislo as min_body on
(min_body.rocnik_id = seminar_cisla.rocnik_id and seminar_cisla.cislo >= min_body.cislo) or
(min_body.rocnik < seminar_rocniky.rocnik)
group by seminar_cisla.id, min_body.resitel_id
order by body desc;
"""
class Migration(migrations.Migration):
dependencies = [("seminar", "0028_add_body_celkem_views")]
operations = [
migrations.RunSQL(sql=CREATE_VIEWS)
]

60
seminar/migrations/0030_add_vysledky.py

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0029_fix_body_celkem_views'),
]
operations = [
migrations.CreateModel(
name='VysledkyCelkemKCislu',
fields=[
('dummy_id', models.CharField(max_length=32, serialize=False, verbose_name='dummy ID pro view', primary_key=True, db_column=b'id')),
('body', models.DecimalField(decimal_places=1, verbose_name='body za \u010d\xedslo', max_digits=8, db_column=b'body')),
('body_celkem', models.DecimalField(decimal_places=1, verbose_name='body celkem do \u010d\xedsla v\u010detn\u011b minul\xfdch ro\u010dn\xedk\u016f', max_digits=8, db_column=b'body_celkem')),
],
options={
'abstract': False,
'db_table': 'seminar_body_celkem_k_cislu',
'managed': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='VysledkyKCisluOdjakziva',
fields=[
('dummy_id', models.CharField(max_length=32, serialize=False, verbose_name='dummy ID pro view', primary_key=True, db_column=b'id')),
('body', models.DecimalField(decimal_places=1, verbose_name='body za \u010d\xedslo', max_digits=8, db_column=b'body')),
],
options={
'abstract': False,
'db_table': 'seminar_body_k_cislu_odjakziva',
'managed': False,
},
bases=(models.Model,),
),
migrations.CreateModel(
name='VysledkyKCisluZaRocnik',
fields=[
('dummy_id', models.CharField(max_length=32, serialize=False, verbose_name='dummy ID pro view', primary_key=True, db_column=b'id')),
('body', models.DecimalField(decimal_places=1, verbose_name='body za \u010d\xedslo', max_digits=8, db_column=b'body')),
],
options={
'abstract': False,
'db_table': 'seminar_body_k_cislu_rocnik',
'managed': False,
},
bases=(models.Model,),
),
migrations.AlterField(
model_name='organizator',
name='foto',
field=models.ImageField(help_text=b'Vlo\xc5\xbe fotografii organiz\xc3\xa1tora o libovoln\xc3\xa9 velikosti', upload_to=b'image_organizatori/velke/%Y/', null=True, verbose_name=b'Fotografie organiz\xc3\xa1tora', blank=True),
preserve_default=True,
),
]

21
seminar/migrations/0031_cislo_pdf.py

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import seminar.models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0030_add_vysledky'),
]
operations = [
migrations.AddField(
model_name='cislo',
name='pdf',
field=models.FileField(help_text='Pdf \u010d\xedsla, kter\xe9 si mohou \u0159e\u0161itel\xe9 st\xe1hnout', upload_to=seminar.models.cislo_pdf_filename, null=True, verbose_name='pdf'),
preserve_default=True,
),
]

44
seminar/migrations/0032_cislo_pdf_blank_typos.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_countries.fields
import seminar.models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0031_cislo_pdf'),
]
operations = [
migrations.AlterModelOptions(
name='soustredeni',
options={'ordering': ['-rocnik__rocnik', '-datum_zacatku'], 'verbose_name': 'Soust\u0159ed\u011bn\xed', 'verbose_name_plural': 'Soust\u0159ed\u011bn\xed'},
),
migrations.AlterField(
model_name='cislo',
name='cislo',
field=models.CharField(help_text='V\u011bt\u0161inou jen "1", vyj\xedme\u010dn\u011b "7-8", lexikograficky ur\u010duje po\u0159ad\xed v ro\u010dn\xedku!', max_length=32, verbose_name='n\xe1zev \u010d\xedsla', db_index=True),
preserve_default=True,
),
migrations.AlterField(
model_name='cislo',
name='pdf',
field=models.FileField(help_text='Pdf \u010d\xedsla, kter\xe9 si mohou \u0159e\u0161itel\xe9 st\xe1hnout', upload_to=seminar.models.cislo_pdf_filename, null=True, verbose_name='pdf', blank=True),
preserve_default=True,
),
migrations.AlterField(
model_name='problem',
name='typ',
field=models.CharField(default=b'uloha', max_length=32, verbose_name='typ probl\xe9mu', choices=[(b'uloha', '\xdaloha'), (b'tema', 'T\xe9ma'), (b'serial', 'Seri\xe1l'), (b'org-clanek', 'Organiz\xe1torsk\xfd \u010dl\xe1nek'), (b'res-clanek', '\u0158e\u0161itelsk\xfd \u010dl\xe1nek')]),
preserve_default=True,
),
migrations.AlterField(
model_name='skola',
name='stat',
field=django_countries.fields.CountryField(default=b'CZ', help_text='ISO 3166-1 k\xf3d zem\u011b velk\xfdmi p\xedsmeny (CZ, SK, ...)', max_length=2, verbose_name='st\xe1t'),
preserve_default=True,
),
]

20
seminar/migrations/0033_organizator_studuje_popisek.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0032_cislo_pdf_blank_typos'),
]
operations = [
migrations.AlterField(
model_name='organizator',
name='studuje',
field=models.CharField(help_text=b"Nap\xc5\x99. 'Studuje Obecnou fyziku (Bc.), 3. ro\xc4\x8dn\xc3\xadk', 'Vystudovala Diskr\xc3\xa9tn\xc3\xad modely a algoritmy (Mgr.)' nebo 'P\xc5\x99edn\xc3\xa1\xc5\xa1\xc3\xad na MFF'", max_length=256, null=True, verbose_name=b'Studium aj.', blank=True),
preserve_default=True,
),
]

20
seminar/migrations/0034_reseni_forma_default_email.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0033_organizator_studuje_popisek'),
]
operations = [
migrations.AlterField(
model_name='reseni',
name='forma',
field=models.CharField(default=b'email', max_length=16, verbose_name='forma \u0159e\u0161en\xed', choices=[(b'papir', 'Pap\xedrov\xe9 \u0159e\u0161en\xed'), (b'email', 'Emailem'), (b'upload', 'Upload p\u0159es web')]),
preserve_default=True,
),
]

25
seminar/migrations/0035_django_imagekit.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import imagekit.models.fields
class Migration(migrations.Migration):
dependencies = [
('seminar', '0034_reseni_forma_default_email'),
]
operations = [
migrations.RemoveField(
model_name='organizator',
name='foto_male',
),
migrations.AlterField(
model_name='organizator',
name='foto',
field=imagekit.models.fields.ProcessedImageField(help_text=b'Vlo\xc5\xbe fotografii organiz\xc3\xa1tora o libovoln\xc3\xa9 velikosti', upload_to=b'image_organizatori/velke/%Y/', null=True, verbose_name=b'Fotografie organiz\xc3\xa1tora', blank=True),
preserve_default=True,
),
]

36
seminar/migrations/0036_add_org_to_soustredeni.py

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('seminar', '0035_django_imagekit'),
]
operations = [
migrations.CreateModel(
name='Soustredeni_Organizatori',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \xfa\u010dasti organiz\xe1tora (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
('organizator', models.ForeignKey(verbose_name='organiz\xe1tor', to='seminar.Organizator', on_delete=models.CASCADE)),
('soustredeni', models.ForeignKey(verbose_name='soust\u0159ed\u011bn\xed', to='seminar.Soustredeni', on_delete=models.CASCADE)),
],
options={
'ordering': ['soustredeni', 'organizator'],
'db_table': 'seminar_soustredeni_organizatori',
'verbose_name': '\xda\u010dast organiz\xe1tor\u016f na soust\u0159ed\u011bn\xed',
'verbose_name_plural': '\xda\u010dasti organiz\xe1tor\u016f na soust\u0159ed\u011bn\xed',
},
bases=(models.Model,),
),
migrations.AddField(
model_name='soustredeni',
name='organizatori',
field=models.ManyToManyField(help_text='Seznam organiz\xe1tor\u016f soust\u0159ed\u011bn\xed', to='seminar.Organizator', verbose_name='Organiz\xe1to\u0159i soust\u0159ed\u011bn\xed', through='seminar.Soustredeni_Organizatori'),
preserve_default=True,
),
]

29
seminar/migrations/0037_prispevek.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0036_add_org_to_soustredeni'),
]
operations = [
migrations.CreateModel(
name='Prispevek',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('nazev', models.CharField(max_length=200, verbose_name=b'N\xc3\xa1zev')),
('text_org', models.TextField(null=True, verbose_name=b'Orgovsk\xc3\xbd text', blank=True)),
('text_resitel', models.TextField(null=True, verbose_name=b'\xc5\x98e\xc5\xa1itelsk\xc3\xbd text', blank=True)),
('zverejnit', models.BooleanField(verbose_name=b'Zve\xc5\x99ejnit?')),
('problem', models.ForeignKey(verbose_name=b'Probl\xc3\xa9m', to='seminar.Problem', on_delete=models.CASCADE)),
('reseni', models.OneToOneField(null=True, blank=True, to='seminar.Reseni', verbose_name=b'\xc5\x98e\xc5\xa1en\xc3\xad', on_delete=models.CASCADE)),
],
options={
'abstract': False,
},
),
]

18
seminar/migrations/0038_change_meta_prispevek.py

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0037_prispevek'),
]
operations = [
migrations.AlterModelOptions(
name='prispevek',
options={'verbose_name': 'P\u0159\xedsp\u011bvek k probl\xe9mu', 'verbose_name_plural': 'P\u0159\xedsp\u011bvky k probl\xe9m\u016fm'},
),
]

34
seminar/migrations/0039_pohadka.py

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('seminar', '0038_change_meta_prispevek'),
]
operations = [
migrations.CreateModel(
name='Pohadka',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('text', models.TextField(verbose_name='Text poh\xe1dky')),
('pred', models.BooleanField(default=True, verbose_name='P\u0159ed \xfalohou')),
('timestamp', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Vytvo\u0159eno', editable=False, blank=True)),
('autor', models.ForeignKey(verbose_name=b'Autor poh\xc3\xa1dky', to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
('uloha', models.ForeignKey(related_name='pohadky', verbose_name='\xdaloha', to='seminar.Problem',on_delete=models.CASCADE)),
],
options={
'ordering': ['uloha__cislo_zadani', 'uloha__kod', '-pred'],
'db_table': 'seminar_pohadky',
'verbose_name': 'Poh\xe1dka',
'verbose_name_plural': 'Poh\xe1dky',
},
),
]

20
seminar/migrations/0040_pohadka_nepovinny_autor.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('seminar', '0039_pohadka'),
]
operations = [
migrations.AlterField(
model_name='pohadka',
name='autor',
field=models.ForeignKey(verbose_name=b'Autor poh\xc3\xa1dky', to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE),
),
]

71
seminar/migrations/0041_konfery.py

@ -0,0 +1,71 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import seminar.models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0040_pohadka_nepovinny_autor'),
]
operations = [
migrations.CreateModel(
name='Konfera',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('nazev', models.CharField(help_text='N\xe1zev konfery', max_length=40, verbose_name='n\xe1zev konfery')),
('popis', models.TextField(help_text='Popis konfery k zobrazen\xed na webu', verbose_name='popis konfery', blank=True)),
('abstrakt', models.TextField(help_text='Abstrakt konfery tak, jak byl uveden ve sborn\xedku', verbose_name='abstrakt', blank=True)),
('org_poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka ke konfe\u0159e(plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
('typ_prezentace', models.CharField(default=b'veletrh', max_length=16, verbose_name='typ prezentace', choices=[(b'veletrh', 'Veletrh (postery)'), (b'prezentace', 'Prezentace (p\u0159edn\xe1\u0161ka)')])),
('prezentace', models.FileField(help_text='Prezentace nebo fotka posteru', upload_to=seminar.models.generate_filename_konfera, verbose_name='prezentace')),
('materialy', models.FileField(help_text='Dal\u0161\xed materi\xe1ly ke konfe\u0159e zabalen\xe9 do jednoho souboru', upload_to=seminar.models.generate_filename_konfera, verbose_name='materialy')),
('organizator', models.ForeignKey(related_name='konfery', on_delete=django.db.models.deletion.SET_NULL, verbose_name='organiz\xe1tor', to='seminar.Organizator', null=True)),
],
options={
'db_table': 'seminar_konfera',
'verbose_name': 'Konfera',
'verbose_name_plural': 'Konfery',
},
),
migrations.CreateModel(
name='Konfery_Ucastnici',
fields=[
('id', models.AutoField(serialize=False, primary_key=True)),
('poznamka', models.TextField(help_text='Neve\u0159ejn\xe1 pozn\xe1mka k \xfa\u010dasti (plain text)', verbose_name='neve\u0159ejn\xe1 pozn\xe1mka', blank=True)),
('konfera', models.ForeignKey(verbose_name='konfera', to='seminar.Konfera',
on_delete=models.PROTECT)),
('resitel', models.ForeignKey(verbose_name='\u0159e\u0161itel', to='seminar.Resitel',on_delete=models.CASCADE)),
],
options={
'ordering': ['konfera', 'resitel'],
'db_table': 'seminar_konfery_ucastnici',
'verbose_name': '\xda\u010dast na konfe\u0159e',
'verbose_name_plural': '\xda\u010dasti na konfe\u0159e',
},
),
migrations.AlterField(
model_name='problem',
name='typ',
field=models.CharField(default=b'uloha', max_length=32, verbose_name='typ probl\xe9mu', choices=[(b'uloha', '\xdaloha'), (b'tema', 'T\xe9ma'), (b'serial', 'Seri\xe1l'), (b'konfera', 'Konfera'), (b'org-clanek', 'Organiz\xe1torsk\xfd \u010dl\xe1nek'), (b'res-clanek', '\u0158e\u0161itelsk\xfd \u010dl\xe1nek')]),
),
migrations.AddField(
model_name='konfera',
name='prispevek',
field=models.ForeignKey(related_name='konfery', on_delete=django.db.models.deletion.SET_NULL, verbose_name='p\u0159\xedsp\u011bvek do \u010d\xedsla', to='seminar.Problem', help_text='\xda\u010dastnick\xfd p\u0159\xedp\u011bvek o konfe\u0159e', null=True),
),
migrations.AddField(
model_name='konfera',
name='soustredeni',
field=models.ForeignKey(related_name='konfery', on_delete=django.db.models.deletion.SET_NULL, verbose_name='soust\u0159ed\u011bn\xed', to='seminar.Soustredeni', null=True),
),
migrations.AddField(
model_name='konfera',
name='ucastnici',
field=models.ManyToManyField(help_text='Seznam \xfa\u010dastn\xedk\u016f konfery', to='seminar.Resitel', verbose_name='\xfa\u010dastn\xedci konfery', through='seminar.Konfery_Ucastnici'),
),
]

31
seminar/migrations/0042_auto_20161005_0847.py

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import seminar.models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0041_konfery'),
]
operations = [
migrations.AlterField(
model_name='konfera',
name='materialy',
field=models.FileField(help_text='Dal\u0161\xed materi\xe1ly ke konfe\u0159e zabalen\xe9 do jednoho souboru', upload_to=seminar.models.generate_filename_konfera, verbose_name='materialy', blank=True),
),
migrations.AlterField(
model_name='konfera',
name='prezentace',
field=models.FileField(help_text='Prezentace nebo fotka posteru', upload_to=seminar.models.generate_filename_konfera, verbose_name='prezentace', blank=True),
),
migrations.AlterField(
model_name='konfera',
name='prispevek',
field=models.ForeignKey(related_name='konfery', on_delete=django.db.models.deletion.SET_NULL, blank=True, to='seminar.Problem', help_text='\xda\u010dastnick\xfd p\u0159\xedp\u011bvek o konfe\u0159e', null=True, verbose_name='p\u0159\xedsp\u011bvek do \u010d\xedsla'),
),
]

19
seminar/migrations/0042_cislo_faze.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0041_konfery'),
]
operations = [
migrations.AddField(
model_name='cislo',
name='faze',
field=models.CharField(default='admin', help_text='B\u011bhem f\xe1ze "admin" se obsah \u010d\xedsla vytv\xe1\u0159\xed (a p\u0159\xedpadn\u011b komentuje) ve webov\xe9m rozhran\xed. B\u011bhem f\xe1ze "tex" u\u017e obsah ve webov\xe9m rozhran\xed editovat nelze. N\xe1vrhy na \xfapravy se pak p\xed\u0161\xed do korekturov\xe1tka a zan\xe1\u0161ej\xed do gitu. Z n\u011bj se pak generuje verze pro web.', max_length=32, verbose_name='F\xe1ze vytv\xe1\u0159en\xed obsahu'),
),
]

19
seminar/migrations/0043_uprava_faze.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0042_cislo_faze'),
]
operations = [
migrations.AlterField(
model_name='cislo',
name='faze',
field=models.CharField(default='admin', help_text='B\u011bhem f\xe1ze "admin" se obsah \u010d\xedsla vytv\xe1\u0159\xed (a p\u0159\xedpadn\u011b komentuje) ve webov\xe9m rozhran\xed. B\u011bhem f\xe1ze "tex" u\u017e obsah ve webov\xe9m rozhran\xed editovat nelze. N\xe1vrhy na \xfapravy se pak p\xed\u0161\xed do korekturov\xe1tka a zan\xe1\u0161ej\xed do gitu. Z n\u011bj se pak generuje verze pro web.', max_length=32, verbose_name='F\xe1ze vytv\xe1\u0159en\xed obsahu', choices=[('admin', 'Zad\xe1v\xe1n\xed \xfaloh do webu'), ('tex', '\xdapravy \xfaloh v TeXov\xe9m repozit\xe1\u0159i')]),
),
]

19
seminar/migrations/0044_uprava_faze.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0043_uprava_faze'),
]
operations = [
migrations.AlterField(
model_name='cislo',
name='faze',
field=models.CharField(default='admin', help_text='B\u011bhem f\xe1ze "\xdapravy na webu" se obsah \u010d\xedsla vytv\xe1\u0159\xed (a p\u0159\xedpadn\u011b komentuje) ve webov\xe9m rozhran\xed. B\u011bhem f\xe1ze "\xdapravy na webu" u\u017e obsah ve webov\xe9m rozhran\xed editovat nelze a n\xe1vrhy na \xfapravy se p\xed\u0161\xed do korekturov\xe1tka a zan\xe1\u0161ej\xed do gitu. Z n\u011bj se pak generuje verze pro web.', max_length=32, verbose_name='F\xe1ze vytv\xe1\u0159en\xed obsahu', choices=[('admin', '\xdapravy na webu'), ('tex', '\xdapravy v TeXu')]),
),
]

19
seminar/migrations/0045_cislo_pridani_faze_nahrano.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0044_uprava_faze'),
]
operations = [
migrations.AlterField(
model_name='cislo',
name='faze',
field=models.CharField(default='admin', help_text='B\u011bhem f\xe1ze "\xdapravy na webu" se obsah \u010d\xedsla vytv\xe1\u0159\xed (a p\u0159\xedpadn\u011b komentuje) ve webov\xe9m rozhran\xed. B\u011bhem f\xe1ze "\xdapravy v TeXu" u\u017e obsah ve webov\xe9m rozhran\xed editovat nelze a n\xe1vrhy na \xfapravy se p\xed\u0161\xed do korekturov\xe1tka a zan\xe1\u0161ej\xed do gitu. Z n\u011bj se pak vygeneruje verze pro web a \u010d\xedslo se p\u0159epne do f\xe1ze "Nahr\xe1no na web", co\u017e jen znamen\xe1, \u017ee u\u017e nejde automaticky st\xe1hnout obsah pro zalo\u017een\xed \u010d\xedsla v TeXu.', max_length=32, verbose_name='F\xe1ze vytv\xe1\u0159en\xed obsahu', choices=[('admin', '\xdapravy na webu'), ('tex', '\xdapravy v TeXu'), ('tex', 'Nahr\xe1no na web')]),
),
]

15
seminar/migrations/0046_merge.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0042_auto_20161005_0847'),
('seminar', '0045_cislo_pridani_faze_nahrano'),
]
operations = [
]

19
seminar/migrations/0047_auto_20170120_2118.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0046_merge'),
]
operations = [
migrations.AlterField(
model_name='cislo',
name='faze',
field=models.CharField(default='admin', help_text='B\u011bhem f\xe1ze "\xdapravy na webu" se obsah \u010d\xedsla vytv\xe1\u0159\xed (a p\u0159\xedpadn\u011b komentuje) ve webov\xe9m rozhran\xed. B\u011bhem f\xe1ze "\xdapravy v TeXu" u\u017e obsah ve webov\xe9m rozhran\xed editovat nelze a n\xe1vrhy na \xfapravy se p\xed\u0161\xed do korekturov\xe1tka a zan\xe1\u0161ej\xed do gitu. Z n\u011bj se pak vygeneruje verze pro web a \u010d\xedslo se p\u0159epne do f\xe1ze "Nahr\xe1no na web", co\u017e jen znamen\xe1, \u017ee u\u017e nejde automaticky st\xe1hnout obsah pro zalo\u017een\xed \u010d\xedsla v TeXu.', max_length=32, verbose_name='F\xe1ze vytv\xe1\u0159en\xed obsahu', choices=[('admin', '\xdapravy na webu'), ('tex', '\xdapravy v TeXu'), ('nahrano', 'Nahr\xe1no na web')]),
),
]

19
seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0047_auto_20170120_2118'),
]
operations = [
migrations.AddField(
model_name='cislo',
name='datum_deadline_soustredeni',
field=models.DateField(help_text='Datum pro p\u0159\xedjem \u0159e\u0161en\xed pro \xfa\u010dast na soust\u0159ed\u011bn\xed', null=True, verbose_name='datum deadline soust\u0159ed\u011bn\xed', blank=True),
),
]

508
seminar/migrations/0049_auto_20190430_2354.py

@ -0,0 +1,508 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-30 21:54
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_countries.fields
import imagekit.models.fields
import taggit.managers
class Migration(migrations.Migration):
atomic = False
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('seminar', '0048_add_cislo_datum_deadline_soustredeni'),
]
operations = [
migrations.CreateModel(
name='Clanek',
fields=[
('problem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem')),
],
options={
'verbose_name': 'Článek',
'verbose_name_plural': 'Články',
'db_table': 'seminar_clanky',
},
bases=('seminar.problem',),
),
migrations.CreateModel(
name='Hodnoceni',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('body', models.DecimalField(decimal_places=1, max_digits=8, verbose_name='body')),
],
options={
'verbose_name': 'Hodnocení',
'verbose_name_plural': 'Hodnocení',
'db_table': 'seminar_hodnoceni',
},
),
migrations.CreateModel(
name='Obrazek',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('na_web', models.ImageField(blank=True, null=True, upload_to='obrazky/%Y/%m/%d/', verbose_name='obrázek na web')),
('do_cisla_barevny', models.FileField(blank=True, help_text='Barevná verze obrázku do čísla', null=True, upload_to='obrazky/%Y/%m/%d/', verbose_name='barevný obrázek do čísla')),
('do_cisla_cernobily', models.FileField(blank=True, help_text='Černobílá verze obrázku do čísla', null=True, upload_to='obrazky/%Y/%m/%d/', verbose_name='černobílý obrázek do čísla')),
],
options={
'verbose_name': 'obrázek',
'verbose_name_plural': 'obrázky',
'db_table': 'seminar_obrazky',
},
),
migrations.CreateModel(
name='Osoba',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('jmeno', models.CharField(max_length=256, verbose_name='jméno')),
('prijmeni', models.CharField(max_length=256, verbose_name='příjmení')),
('prezdivka', models.CharField(max_length=256, verbose_name='přezdívka')),
('pohlavi_muz', models.BooleanField(default=False, verbose_name='pohlaví (muž)')),
('email', models.EmailField(blank=True, default='', max_length=256, verbose_name='e-mail')),
('telefon', models.CharField(blank=True, default='', max_length=256, verbose_name='telefon')),
('datum_narozeni', models.DateField(blank=True, null=True, verbose_name='datum narození')),
('datum_souhlasu_udaje', models.DateField(blank=True, help_text='Datum souhlasu se zpracováním osobních údajů', null=True, verbose_name='datum souhlasu (údaje)')),
('datum_souhlasu_zasilani', models.DateField(blank=True, help_text='Datum souhlasu se zasíláním MFF materiálů', null=True, verbose_name='datum souhlasu (spam)')),
('datum_registrace', models.DateField(default=django.utils.timezone.now, verbose_name='datum registrace do semináře')),
('ulice', models.CharField(blank=True, default='', max_length=256, verbose_name='ulice')),
('mesto', models.CharField(blank=True, default='', max_length=256, verbose_name='město')),
('psc', models.CharField(blank=True, default='', max_length=32, verbose_name='PSČ')),
('stat', django_countries.fields.CountryField(default='CZ', help_text='ISO 3166-1 kód země velkými písmeny (CZ, SK, ...)', max_length=2, verbose_name='stát')),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k osobě (plain text)', verbose_name='neveřejná poznámka')),
('foto', imagekit.models.fields.ProcessedImageField(blank=True, help_text='Vlož fotografii osoby o libovolné velikosti', null=True, upload_to='image_osoby/velke/%Y/', verbose_name='Fotografie osoby')),
('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='uživatel')),
],
options={
'verbose_name': 'Osoba',
'verbose_name_plural': 'Osoby',
'db_table': 'seminar_osoby',
'ordering': ['prijmeni', 'jmeno'],
},
),
migrations.CreateModel(
name='Prijemce',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('poznamka', models.TextField(blank=True, help_text='Neveřejná poznámka k příemci čísel (plain text)', verbose_name='neveřejná poznámka')),
('osoba', models.ForeignKey(help_text='Které osobě či na jakou adresu se mají zasílat čísla', on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='komu')),
],
options={
'verbose_name': 'příjemce',
'verbose_name_plural': 'příjemce',
'db_table': 'seminar_prijemce',
},
),
migrations.CreateModel(
name='Reseni_Resitele',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
],
options={
'verbose_name': 'Řešení řešitelů',
'verbose_name_plural': 'Řešení řešitelů',
'db_table': 'seminar_reseni_resitele',
'ordering': ['reseni', 'resitele'],
},
),
migrations.CreateModel(
name='Tema',
fields=[
('problem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem')),
('tema_typ', models.CharField(choices=[('tema', 'Téma'), ('serial', 'Seriál')], default='tema', max_length=16, verbose_name='Typ tématu')),
],
options={
'verbose_name': 'Téma',
'verbose_name_plural': 'Témata',
'db_table': 'seminar_temata',
},
bases=('seminar.problem',),
),
migrations.CreateModel(
name='Text',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('na_web', models.TextField(blank=True, help_text='Text ke zveřejnění na webu', verbose_name='text na web')),
('do_cisla', models.TextField(blank=True, help_text='Text ke zveřejnění v čísle', verbose_name='text do čísla')),
],
options={
'verbose_name': 'text',
'verbose_name_plural': 'texty',
'db_table': 'seminar_texty',
},
),
migrations.CreateModel(
name='Uloha',
fields=[
('problem_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='seminar.Problem')),
('max_body', models.DecimalField(blank=True, decimal_places=1, max_digits=8, null=True, verbose_name='maximum bodů')),
],
options={
'verbose_name': 'Úloha',
'verbose_name_plural': 'Úlohy',
'db_table': 'seminar_ulohy',
},
bases=('seminar.problem',),
),
migrations.AlterModelOptions(
name='novinky',
options={'ordering': ['-datum'], 'verbose_name': 'Novinka', 'verbose_name_plural': 'Novinky'},
),
migrations.AlterModelOptions(
name='prilohareseni',
options={'ordering': ['reseni', 'vytvoreno'], 'verbose_name': 'Příloha řešení', 'verbose_name_plural': 'Přílohy řešení'},
),
migrations.AlterModelOptions(
name='reseni',
options={'ordering': ['-cas_doruceni'], 'verbose_name': 'Řešení', 'verbose_name_plural': 'Řešení'},
),
migrations.AlterModelOptions(
name='resitel',
options={'ordering': ['osoba'], 'verbose_name': 'Řešitel', 'verbose_name_plural': 'Řešitelé'},
),
migrations.RenameField(
model_name='konfera',
old_name='org_poznamka',
new_name='poznamka',
),
migrations.RenameField(
model_name='pohadka',
old_name='timestamp',
new_name='vytvoreno',
),
migrations.RenameField(
model_name='reseni',
old_name='timestamp',
new_name='cas_doruceni',
),
migrations.RenameField(
model_name='prilohareseni',
old_name='timestamp',
new_name='vytvoreno',
),
migrations.RenameField(
model_name='problem',
old_name='text_org',
new_name='poznamka',
),
migrations.RenameField(
model_name='problem',
old_name='timestamp',
new_name='vytvoreno',
),
migrations.RenameField(
model_name='problem',
old_name='cislo_zadani',
new_name='cislo_zadani_old',
),
migrations.RenameField(
model_name='problem',
old_name='cislo_reseni',
new_name='cislo_reseni_old',
),
migrations.AddField(
model_name='konfera',
name='anotace',
field=models.TextField(blank=True, help_text='Popis, o čem bude konfera.', verbose_name='anotace'),
),
migrations.AddField(
model_name='konfera',
name='reseni',
field=models.ForeignKey(blank=True, help_text='Účastnický přípěvek o konfeře', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='konfery', to='seminar.Reseni', verbose_name='článek ke konfeře'),
),
migrations.AddField(
model_name='organizator',
name='organizuje_do',
field=models.DateTimeField(blank=True, null=True, verbose_name='Organizuje do'),
),
migrations.AddField(
model_name='organizator',
name='organizuje_od',
field=models.DateTimeField(null=True,blank=True, verbose_name='Organizuje od'),
),
migrations.AddField(
model_name='organizator',
name='skola',
field=models.CharField(blank=True, help_text='Škola, např. MFF, VŠCHT, VUT, ... prostě aby se nemuselo psát do studuješkolu, ale jen obor, možnost zobrazit zvlášť', max_length=256, null=True, verbose_name='Škola, kterou studuje'),
),
migrations.AddField(
model_name='organizator',
name='vytvoreno',
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, editable=False, verbose_name='Vytvořeno'),
),
migrations.AddField(
model_name='problem',
name='garant',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='garant_problemu_problem', to='seminar.Organizator', verbose_name='garant zadaného problému'),
),
migrations.AddField(
model_name='problem',
name='nadproblem',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='nadproblem_problem', to='seminar.Problem', verbose_name='nadřazený problém'),
),
migrations.AddField(
model_name='problem',
name='opravovatele',
field=models.ManyToManyField(blank=True, related_name='opravovatele_problem', to='seminar.Organizator', verbose_name='opravovatelé'),
),
migrations.AddField(
model_name='reseni',
name='zverejneno',
field=models.BooleanField(default=False, help_text='Udává, zda je řešení zveřejněno', verbose_name='řešení zveřejněno'),
),
migrations.AlterField(
model_name='cislo',
name='verejna_vysledkovka',
field=models.BooleanField(default=False, help_text='Je-li false u veřejného čísla,\t\t\t\t není výsledkovka zatím veřejná.', verbose_name='zveřejněna výsledkovka'),
),
migrations.AlterField(
model_name='cislo',
name='verejne_db',
field=models.BooleanField(db_column='verejne', default=False, verbose_name='číslo zveřejněno'),
),
migrations.AlterField(
model_name='konfera',
name='typ_prezentace',
field=models.CharField(choices=[('veletrh', 'Veletrh (postery)'), ('prezentace', 'Prezentace (přednáška)')], default='veletrh', max_length=16, verbose_name='typ prezentace'),
),
migrations.RenameField(
model_name='novinky',
old_name='autor',
new_name='autor_old'
),
migrations.AddField(
model_name='novinky',
name='autor',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Organizator', verbose_name='Autor novinky', null=True),
),
migrations.AlterField(
model_name='novinky',
name='obrazek',
field=models.ImageField(blank=True, null=True, upload_to='image_novinky/%Y/%m/%d/', verbose_name='Obrázek'),
),
migrations.AlterField(
model_name='novinky',
name='text',
field=models.TextField(blank=True, null=True, verbose_name='Text novinky'),
),
migrations.AlterField(
model_name='novinky',
name='zverejneno',
field=models.BooleanField(default=False, verbose_name='Zveřejněno'),
),
migrations.AlterField(
model_name='organizator',
name='strucny_popis_organizatora',
field=models.TextField(blank=True, null=True, verbose_name='Stručný popis organizátora'),
),
migrations.AlterField(
model_name='organizator',
name='studuje',
field=models.CharField(blank=True, help_text="Např. 'Studuje Obecnou fyziku (Bc.), 3. ročník', 'Vystudovala Diskrétní modely a algoritmy (Mgr.)' nebo 'Přednáší na MFF'", max_length=256, null=True, verbose_name='Studium aj.'),
),
migrations.RenameField(
model_name='pohadka',
old_name='autor',
new_name='autor_old'
),
migrations.AddField(
model_name='pohadka',
name='autor',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Organizator', verbose_name='Autor pohádky'),
),
migrations.RenameField(
model_name='pohadka',
old_name='uloha',
new_name='uloha_old'
),
migrations.AddField(
model_name='pohadka',
name='uloha',
field=models.ForeignKey(null=True,on_delete=django.db.models.deletion.CASCADE, related_name='pohadky', to='seminar.Uloha', verbose_name='Úloha'),
),
migrations.RenameField(
model_name='problem',
old_name='autor',
new_name='autor_old',
),
migrations.AddField(
model_name='problem',
name='autor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='autor_problemu_problem', to='seminar.Organizator', verbose_name='autor problému'),
),
migrations.AlterField(
model_name='problem',
name='kod',
field=models.CharField(blank=True, default='', help_text='Číslo/kód úlohy v čísle nebo kód tématu/článku/seriálu v ročníku', max_length=32, verbose_name='lokální kód'),
),
migrations.AlterField(
model_name='problem',
name='stav',
field=models.CharField(choices=[('navrh', 'Návrh'), ('zadany', 'Zadaný'), ('vyreseny', 'Vyřešený'), ('smazany', 'Smazaný')], default='navrh', max_length=32, verbose_name='stav problému'),
),
migrations.AlterField(
model_name='problem',
name='zamereni',
field=taggit.managers.TaggableManager(blank=True, help_text='Zaměření M/F/I/O problému, příp. další tagy', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='zaměření'),
),
migrations.AlterField(
model_name='reseni',
name='forma',
field=models.CharField(choices=[('papir', 'Papírové řešení'), ('email', 'Emailem'), ('upload', 'Upload přes web')], default='email', max_length=16, verbose_name='forma řešení'),
),
migrations.RenameField(
model_name='reseni',
old_name='problem',
new_name='problem_old',
),
migrations.AlterField(
model_name='resitel',
name='zasilat',
field=models.CharField(choices=[('domu', 'Domů'), ('do_skoly', 'Do školy'), ('nikam', 'Nikam')], default='domu', max_length=32, verbose_name='kam zasílat'),
),
migrations.AlterField(
model_name='rocnik',
name='exportovat',
field=models.BooleanField(db_column='exportovat', default=False, help_text='Exportuje se jen podle tohoto flagu (ne veřejnosti), a to jen čísla s veřejnou výsledkovkou', verbose_name='export do AESOPa'),
),
migrations.AlterField(
model_name='skola',
name='aesop_id',
field=models.CharField(blank=True, default='', help_text='Aesopi ID typu "izo:..." nebo "aesop:..."', max_length=32, verbose_name='Aesop ID'),
),
migrations.AlterField(
model_name='skola',
name='kratky_nazev',
field=models.CharField(blank=True, help_text='Zkrácený název pro zobrazení ve výsledkovce', max_length=256, verbose_name='zkrácený název'),
),
migrations.AlterField(
model_name='skola',
name='stat',
field=django_countries.fields.CountryField(default='CZ', help_text='ISO 3166-1 kód země velkými písmeny (CZ, SK, ...)', max_length=2, verbose_name='stát'),
),
migrations.AlterField(
model_name='soustredeni',
name='exportovat',
field=models.BooleanField(db_column='exportovat', default=False, help_text='Exportuje se jen podle tohoto flagu (ne veřejnosti)', verbose_name='export do AESOPa'),
),
migrations.AlterField(
model_name='soustredeni',
name='misto',
field=models.CharField(blank=True, default='', help_text='Místo (název obce, volitelně též objektu', max_length=256, verbose_name='místo soustředění'),
),
migrations.AlterField(
model_name='soustredeni',
name='text',
field=models.TextField(blank=True, default='', verbose_name='text k soustředění (HTML)'),
),
migrations.AlterField(
model_name='soustredeni',
name='typ',
field=models.CharField(choices=[('jarni', 'Jarní soustředění'), ('podzimni', 'Podzimní soustředění'), ('vikend', 'Víkendový sraz')], default='podzimni', max_length=16, verbose_name='typ akce'),
),
migrations.AlterField(
model_name='soustredeni',
name='verejne_db',
field=models.BooleanField(db_column='verejne', default=False, verbose_name='soustředění zveřejněno'),
),
migrations.AlterModelTable(
name='problem',
table='seminar_problemy',
),
migrations.AddField(
model_name='uloha',
name='cislo_deadline',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='deadlinove_ulohy', to='seminar.Cislo', verbose_name='číslo deadlinu'),
),
migrations.AddField(
model_name='uloha',
name='cislo_reseni',
field=models.ForeignKey(blank=True, help_text='Číslo s řešením úlohy, jen pro úlohy', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='resene_ulohy', to='seminar.Cislo', verbose_name='číslo řešení'),
),
migrations.AddField(
model_name='uloha',
name='cislo_zadani',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='zadane_ulohy', to='seminar.Cislo', verbose_name='číslo zadání'),
),
migrations.AddField(
model_name='tema',
name='rocnik',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Rocnik', verbose_name='ročník'),
),
migrations.AddField(
model_name='reseni_resitele',
name='reseni',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Reseni', verbose_name='řešení'),
),
migrations.AddField(
model_name='reseni_resitele',
name='resitele',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Resitel', verbose_name='řešitel'),
),
migrations.AddField(
model_name='obrazek',
name='text',
field=models.ForeignKey(help_text='text, ve kterém se obrázek vyskytuje', on_delete=django.db.models.deletion.CASCADE, to='seminar.Text', verbose_name='text'),
),
migrations.AddField(
model_name='hodnoceni',
name='cislo_body',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='hodnoceni', to='seminar.Cislo', verbose_name='číslo pro body'),
),
migrations.AddField(
model_name='hodnoceni',
name='problem',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Problem', verbose_name='problém'),
),
migrations.AddField(
model_name='hodnoceni',
name='reseni',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Reseni', verbose_name='řešení'),
),
migrations.AddField(
model_name='clanek',
name='cislo',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Cislo', verbose_name='číslo'),
),
migrations.AddField(
model_name='organizator',
name='osoba',
field=models.ForeignKey(help_text='osobní údaje organizátora', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='org', to='seminar.Osoba', verbose_name='osoba'),
),
migrations.AddField(
model_name='reseni',
name='resitele',
field=models.ManyToManyField(help_text='Seznam autorů řešení', through='seminar.Reseni_Resitele', to='seminar.Resitel', verbose_name='autoři řešení'),
),
migrations.AddField(
model_name='reseni',
name='text_cely',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reseni_cely_set', to='seminar.Text', verbose_name='Plná verze textu řešení'),
),
migrations.AddField(
model_name='reseni',
name='text_zkraceny',
field=models.ManyToManyField(help_text='Seznam úryvků z řešení', related_name='reseni_zkraceny_set', to='seminar.Text', verbose_name='zkrácené verze řešení'),
),
migrations.AddField(
model_name='resitel',
name='osoba',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='osoba'),
),
migrations.AddField(
model_name='skola',
name='kontaktni_osoba',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='Kontaktní osoba'),
),
migrations.AddField(
model_name='reseni',
name='problem',
field=models.ManyToManyField(help_text='Problém', through='seminar.Hodnoceni', to='seminar.Problem', verbose_name='problém'),
),
]

191
seminar/migrations/0050_auto_20190510_2228.py

@ -0,0 +1,191 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-10 20:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('seminar', '0049_auto_20190430_2354'),
]
operations = [
migrations.AlterField(
model_name='konfera',
name='reseni',
field=models.OneToOneField(blank=True, help_text='Účastnický přípěvek o konfeře', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='konfery', to='seminar.Reseni', verbose_name='článek ke konfeře'),
),
migrations.AlterField(
model_name='organizator',
name='osoba',
field=models.OneToOneField(help_text='osobní údaje organizátora', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='org', to='seminar.Osoba', verbose_name='osoba'),
),
migrations.AlterField(
model_name='reseni',
name='text_cely',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='reseni_cely_set', to='seminar.Text', verbose_name='Plná verze textu řešení'),
),
migrations.AlterField(
model_name='resitel',
name='osoba',
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='osoba'),
),
migrations.CreateModel(
name='TreeNode',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
],
options={
'verbose_name': 'TreeNode',
'verbose_name_plural': 'TreeNody',
'db_table': 'seminar_nodes_treenode',
},
),
migrations.CreateModel(
name='CisloNode',
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')),
('cislo', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Cislo', verbose_name='číslo')),
],
options={
'verbose_name': 'Číslo (Node)',
'verbose_name_plural': 'Čísla (Node)',
'db_table': 'seminar_nodes_cislo',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='ClanekNode',
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')),
('clanek', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Clanek', verbose_name='článek')),
],
options={
'verbose_name': 'Článek (Node)',
'verbose_name_plural': 'Články (Node)',
'db_table': 'seminar_nodes_clanek',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='KonferaNode',
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')),
('konfera', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Konfera', verbose_name='konfera')),
],
options={
'verbose_name': 'Konfera (Node)',
'verbose_name_plural': 'Konfery (Node)',
'db_table': 'seminar_nodes_konfera',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='MezicisloNode',
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')),
],
options={
'verbose_name': 'Mezičíslo (Node)',
'verbose_name_plural': 'Mezičísla (Node)',
'db_table': 'seminar_nodes_mezicislo',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='RocnikNode',
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')),
('rocnik', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Rocnik', verbose_name='ročník')),
],
options={
'verbose_name': 'Ročník (Node)',
'verbose_name_plural': 'Ročníky (Node)',
'db_table': 'seminar_nodes_rocnik',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='TemaVCisleNode',
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')),
('tema', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Tema', verbose_name='téma v čísle')),
],
options={
'verbose_name': 'Téma v čísle (Node)',
'verbose_name_plural': 'Témata v čísle (Node)',
'db_table': 'seminar_nodes_temavcisle',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='TextNode',
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')),
('text', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Text', verbose_name='text')),
],
options={
'verbose_name': 'Text (Node)',
'verbose_name_plural': 'Text (Node)',
'db_table': 'seminar_nodes_obsah',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='UlohaVzorakNode',
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')),
('uloha', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Uloha', verbose_name='úloha')),
],
options={
'verbose_name': 'Vzorák úlohy (Node)',
'verbose_name_plural': 'Vzoráky úloh (Node)',
'db_table': 'seminar_nodes_uloha_vzorak',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='UlohaZadaniNode',
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')),
('uloha', models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Uloha', verbose_name='úloha')),
],
options={
'verbose_name': 'Zadání úlohy (Node)',
'verbose_name_plural': 'Zadání úloh (Node)',
'db_table': 'seminar_nodes_uloha_zadani',
},
bases=('seminar.treenode',),
),
migrations.CreateModel(
name='PohadkaNode',
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')),
('pohadka', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='seminar.Pohadka', verbose_name='pohádka')),
],
options={
'verbose_name': 'Pohádka (Node)',
'verbose_name_plural': 'Pohádky (Node)',
'db_table': 'seminar_nodes_pohadka',
},
bases=('seminar.treenode',),
),
migrations.AddField(
model_name='treenode',
name='first_child',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.TreeNode', verbose_name='první potomek'),
),
migrations.AddField(
model_name='treenode',
name='root',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='potomci_set', to='seminar.TreeNode', verbose_name='kořen stromu'),
),
migrations.AddField(
model_name='treenode',
name='succ',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prev', to='seminar.TreeNode', verbose_name='další element na stejné úrovni'),
),
]

89
seminar/migrations/0051_resitel_to_osoba.py

@ -0,0 +1,89 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-10 20:44
from __future__ import unicode_literals
from django.db import migrations
def resitel_to_osoba(apps,schema_editor):
Resitel = apps.get_model('seminar','Resitel')
Osoba = apps.get_model('seminar','Osoba')
for r in Resitel.objects.all():
o = Osoba()
o.datum_narozeni = r.datum_narozeni
o.datum_registrace = r.datum_prihlaseni
o.datum_souhlasu_udaje = r.datum_souhlasu_udaje
o.datum_souhlasu_zasilani = r.datum_souhlasu_zasilani
o.email = r.email
o.jmeno = r.jmeno
o.mesto = r.mesto
o.pohlavi_muz = r.pohlavi_muz
o.prijmeni = r.prijmeni
o.psc = r.psc
o.stat = r.stat
o.telefon = r.telefon
o.ulice = r.ulice
o.user = r.user
if o.user:
u = o.user
if u.first_name:
if not o.jmeno:
o.jmeno = u.first_name
u.first_name = 'Použij osobu!'
elif o.jmeno == u.first_name:
u.first_name = 'Použij osobu!'
else:
raise ValueError('jmeno a first_name rozdílné: "{}" vs. "{}"'.format(o.jmeno, u.first_name))
if u.last_name:
if not o.prijmeni:
o.prijmeni = u.last_name
u.last_name = 'Použij osobu!'
elif o.prijmeni == u.last_name:
u.last_name = 'Použij osobu!'
else:
raise ValueError('prijmeni a last_name rozdílné: "{}" vs. "{}"'.format(o.prijmeni, u.last_name))
if u.email:
if not o.email:
o.email = u.email
u.email = 'Použij osobu!'
elif o.email == u.email:
u.email = 'Použij osobu!'
else:
raise ValueError('o.email a u.email rozdílné: "{}" vs. "{}"'.format(o.email, u.email))
u.save()
o.save()
r.osoba = o
r.save()
def osoba_to_resitel(apps, schema_editor):
Resitel = apps.get_model('seminar','Resitel')
Osoba = apps.get_model('seminar','Osoba')
for r in Resitel.objects.all():
o = r.osoba
r.datum_narozeni = o.datum_narozeni
r.datum_prihlaseni = o.datum_registrace
r.datum_souhlasu_udaje = o.datum_souhlasu_udaje
r.datum_souhlasu_zasilani = o.datum_souhlasu_zasilani
r.email = o.email
r.jmeno = o.jmeno
r.mesto = o.mesto
r.pohlavi_muz = o.pohlavi_muz
r.prijmeni = o.prijmeni
r.psc = o.psc
r.stat = o.stat
r.telefon = o.telefon
r.ulice = o.ulice
r.user = o.user
r.save()
o.delete()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0050_auto_20190510_2228'),
]
operations = [
migrations.RunPython(resitel_to_osoba, osoba_to_resitel),
]

82
seminar/migrations/0052_user_to_organizator.py

@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-05-16 20:59
from __future__ import unicode_literals
from django.db import migrations
def spoj_k_organizatorum_osoby(apps, scema_editor):
Organizator = apps.get_model('seminar', 'Organizator')
Resitel = apps.get_model('seminar', 'Resitel')
Osoba = apps.get_model('seminar', 'Osoba')
for org in Organizator.objects.all():
# Spárování organizátora s osobou
user = org.user
resitele = Resitel.objects.filter(user=user)
if resitele.count() != 0:
osoba = resitele.first().osoba
else:
osoba = Osoba(user=user)
# Přesun informací z usera do osoby
# pro řešitele již v minule migraci
osoba.jmeno = user.first_name
osoba.prijmeni = user.last_name
osoba.email = user.email
user.jmeno = "Použij osobu!"
user.prijmeni = "Použij osobu!"
user.email = "Použij osobu!"
user.save()
# Přesun informací z organizátora do jeho osoby
osoba.prezdivka = org.prezdivka if org.prezdivka is not None else ''
osoba.foto = org.foto
# Všechno uložit
osoba.save()
org.osoba = osoba
org.save()
def fix_problem(apps, schema_editor):
Problem = apps.get_model('seminar', 'Problem')
Organizator = apps.get_model('seminar', 'Organizator')
for pr in Problem.objects.all():
if pr.autor_old is not None:
pr.autor = Organizator.objects.filter(osoba__user=pr.autor_old).first()
else:
pr.autor = None
if pr.opravovatel is not None:
pr.opravovatele.add(Organizator.objects.filter(osoba__user=pr.opravovatel).first())
pr.save()
def fix_pohadka(apps, schema_editor):
Pohadka = apps.get_model('seminar', 'Pohadka')
Organizator = apps.get_model('seminar', 'Organizator')
for poh in Pohadka.objects.all():
if poh.autor_old is not None:
poh.autor = Organizator.objects.filter(osoba__user=poh.autor_old).first()
else:
poh.autor = None
poh.save()
def fix_novinka(apps, schema_editor):
Novinky = apps.get_model('seminar', 'Novinky')
Organizator = apps.get_model('seminar', 'Organizator')
for nov in Novinky.objects.all():
nov.autor = Organizator.objects.filter(osoba__user=nov.autor_old).first()
nov.save()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0051_resitel_to_osoba'),
]
operations = [
migrations.RunPython(spoj_k_organizatorum_osoby),
migrations.RunPython(fix_problem),
migrations.RunPython(fix_pohadka),
migrations.RunPython(fix_novinka),
]

36
seminar/migrations/0053_organizator_organizuje_od_do.py

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-16 21:26
from __future__ import unicode_literals
import datetime as dt
from django.db import migrations
def rok_to_datetime(apps,schema_editor):
Organizator = apps.get_model('seminar','Organizator')
for o in Organizator.objects.all():
rok = o.organizuje_od_roku
if rok:
o.organizuje_od = dt.datetime(rok,1,1)
rok = o.organizuje_do_roku
if rok:
o.organizuje_do = dt.datetime(rok,12,31)
o.save()
def datetime_to_rok(apps,schema_editor):
Organizator = apps.get_model('seminar','Organizator')
for o in Organizator.objects.all():
o.organizuje_od_roku = o.organizuje_od.year
o.organizuje_do_roku = o.organizuje_do.year
o.save()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0052_user_to_organizator'),
]
operations = [
migrations.RunPython(rok_to_datetime, datetime_to_rok),
]

56
seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py

@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-23 20:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0053_organizator_organizuje_od_do'),
]
operations = [
migrations.RemoveField(
model_name='prispevek',
name='problem',
),
migrations.RemoveField(
model_name='prispevek',
name='reseni',
),
migrations.DeleteModel(
name='ProblemNavrh',
),
migrations.DeleteModel(
name='ProblemZadany',
),
migrations.RemoveField(
model_name='cislo',
name='faze',
),
migrations.RemoveField(
model_name='konfera',
name='popis',
),
migrations.RemoveField(
model_name='konfera',
name='prispevek',
),
migrations.RemoveField(
model_name='problem',
name='import_dakos_id',
),
migrations.RemoveField(
model_name='resitel',
name='import_mamoper_id',
),
migrations.RemoveField(
model_name='skola',
name='import_dakos_id',
),
migrations.DeleteModel(
name='Prispevek',
),
]

47
seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-23 21:54
from __future__ import unicode_literals
from django.db import migrations
def generuj_RocnikNody_a_CisloNody(apps,schema_editor):
Rocnik = apps.get_model('seminar', 'Rocnik')
RocnikNode = apps.get_model('seminar', 'RocnikNode')
Cislo = apps.get_model('seminar', 'Cislo')
CisloNode = apps.get_model('seminar', 'CisloNode')
last_rn = None # last_* slouží k navázání následníků
for r in Rocnik.objects.all():
rn = RocnikNode.objects.create(rocnik=r)
rn.save()
rn.root = rn
rn.save()
if last_rn:
last_rn.succ = rn
last_rn.save()
last_rn = rn
last_cn = None
for c in Cislo.objects.filter(rocnik=r):
cn = CisloNode.objects.create(cislo=c, root=rn)
cn.save()
if last_cn: # Jsme něčí následník
last_cn.succ = cn
last_cn.save()
else: # Jsme první v řadě, takže se musíme přidat jako first_child RočníkNodu
rn.first_child = cn
rn.save()
last_cn = cn
class Migration(migrations.Migration):
dependencies = [
('seminar', '0055_smazat_nemigrovane_zastarale_veci'),
]
operations = [
migrations.RunPython(generuj_RocnikNody_a_CisloNody),
]

34
seminar/migrations/0057_reseni_to_reseni_hodnoceni.py

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-28 21:46
from __future__ import unicode_literals
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():
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):
dependencies = [
('seminar', '0056_vrcholy_pro_rocniky_a_cisla'),
]
operations = [
migrations.RunPython(reseni_to_Reseni)
]

161
seminar/migrations/0058_problem_to_uloha_tema_clanek.py

@ -0,0 +1,161 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-17 17:44
from __future__ import unicode_literals
from django.db import migrations
from django.db.models import Q
def poskladej_strom(apps, rodic, *texty):
Text = apps.get_model('seminar', 'Text')
TextNode = apps.get_model('seminar', 'TextNode')
if not rodic:
raise ValueError("Rodič musí být definovaný")
uz_ma_deti = False
tn = None
for txt in texty:
if not txt:
continue
# Přidej do stromu:
textobj = Text.objects.create(na_web = txt)
textobj.save()
textnode = TextNode.objects.create(text = textobj)
textnode.save()
if not uz_ma_deti:
rodic.first_child = textnode
rodic.save()
tn = rodic.first_child
uz_ma_deti = True
else:
tn.succ = textnode
tn.save()
tn = tn.succ
def uloha_to_Uloha(apps,schema_editor):
Problem = apps.get_model('seminar', 'Problem')
Uloha = apps.get_model('seminar', 'Uloha')
Text = apps.get_model('seminar', 'Text')
UlohaZadaniNode = apps.get_model('seminar', 'UlohaZadaniNode')
UlohaVzorakNode = apps.get_model('seminar', 'UlohaVzorakNode')
TextNode = apps.get_model('seminar', 'TextNode')
ulohy = Problem.objects.filter(typ = 'uloha')
for uold in ulohy:
unew = Uloha.objects.create(
problem_ptr = uold,
# Zakomentované fieldy by se už měly nacházet v příslušném problému
#nazev = uold.nazev,
#stav = uold.stav,
#zamereni = uold.zamereni,
#poznamka = uold.poznamka,
#autor = uold.autor,
#kod = uold.kod,
cislo_zadani = uold.cislo_zadani_old,
cislo_reseni = uold.cislo_reseni_old,
max_body = uold.body,
#vytvoreno = uold.vytvoreno,
)
# unew.opravovatele.add(*uold.opravovatele.all())
unew.save()
# Nody:
zadani_node = UlohaZadaniNode.objects.create(uloha = unew)
poskladej_strom(apps, zadani_node, uold.text_zadani)
zadani_node.save()
vzorak_node = UlohaVzorakNode.objects.create(uloha = unew)
poskladej_strom(apps, vzorak_node, uold.text_reseni)
vzorak_node.save()
def konfery_rucne(apps, schema_editor):
# Tohle dělat nebudu, máme aktuálně celou jednu. Ale "Errors should never pass silently"
Problem = apps.get_model('seminar', 'Problem')
pocet_konfer = Problem.objects.filter(typ = 'konfera').count()
if pocet_konfer > 0:
raise NotImplementedError("Zkonvertuj {} konfer na objekt Konfera ručně, prosím".format(pocet_konfer))
def clanek_to_Clanek(apps,schema_editor):
Problem = apps.get_model('seminar', 'Problem')
Clanek = apps.get_model('seminar', 'Clanek')
ClanekNode = apps.get_model('seminar', 'ClanekNode')
Text = apps.get_model('seminar', 'Text')
TextNode = apps.get_model('seminar', 'TextNode')
clanky = Problem.objects.filter(Q(typ='org-clanek') | Q(typ='res-clanek'))
for cl in clanky:
# Vybereme vhodné číslo pro článek z čísla zadání a čísla řešení:
if cl.cislo_zadani_old is None:
cislo = cl.cislo_reseni_old
elif cl.cislo_reseni_old is None:
cislo = cl.cislo_zadani_old
elif cl.cislo_reseni_old == cl.cislo_zadani_old:
cislo = cl.cislo_zadani_old
else:
raise ValueError("Různá čísla zadání a řešení u článku! (Článek: {})".format(cl.nazev))
clnew = Clanek.objects.create(
problem_ptr = cl,
# Problém by nemělo být potřeba upravovat
cislo = cislo,
# Body ignorujeme, protože už jsou v hodnocení
)
clnew.save()
# Aktuálně nemáme v modelu informaci o tom, jestli je to org-článek
# nebo řešitelský článek. Aby se neztratila informace, poznamenám to do
# poznámky.
cl.poznamka += "\nTyp:\t{}".format(cl.typ)
cl.save()
# Vyrobíme nody:
clnode = ClanekNode(clanek = clnew)
poskladej_strom(apps, clnode, cl.text_zadani, cl.text_reseni)
clnode.save()
def tema_to_Tema(apps, schema_editor):
Problem = apps.get_model('seminar', 'Problem')
Tema = apps.get_model('seminar', 'Tema')
TemaVCisleNode = apps.get_model('seminar', 'TemaVCisleNode')
Text = apps.get_model('seminar', 'Text')
TextNode = apps.get_model('seminar', 'TextNode')
temata = Problem.objects.filter(Q(typ = 'tema') | Q(typ='serial'))
for t in temata:
# Vymyslíme správně ročník:
if t.cislo_zadani_old is None and t.cislo_reseni_old is None:
rocnik = None
elif t.cislo_zadani_old is None:
rocnik = t.cislo_reseni_old.rocnik
elif t.cislo_reseni_old is None:
rocnik = t.cislo_zadani_old.rocnik
elif t.cislo_reseni_old.rocnik == t.cislo_zadani_old.rocnik:
rocnik = t.cislo_zadani_old.rocnik
else:
raise ValueError("Nelze mít téma přes více ročníků! (Téma: {}".format(t.nazev))
tnew = Tema.objects.create(
problem_ptr = t,
tema_typ = t.typ,
rocnik = rocnik,
)
tnew.save()
# Nody:
tnode = TemaVCisleNode(tema = tnew)
poskladej_strom(apps, tnode, t.text_zadani, t.text_reseni)
tnode.save()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0057_reseni_to_reseni_hodnoceni'),
]
operations = [
# ashes to Ashes, dust to Dust....
migrations.RunPython(uloha_to_Uloha),
migrations.RunPython(tema_to_Tema),
migrations.RunPython(clanek_to_Clanek),
migrations.RunPython(konfery_rucne),
]

29
seminar/migrations/0059_vytvorit_pohadkanode.py

@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-29 03:26
from __future__ import unicode_literals
from django.db import migrations
def vytvor_pohadkanode(apps, schema_editor):
Pohadka = apps.get_model('seminar', 'Pohadka')
PohadkaNode = apps.get_model('seminar', 'PohadkaNode')
Text = apps.get_model('seminar', 'Text')
TextNode = apps.get_model('seminar', 'TextNode')
for p in Pohadka.objects.all():
t = Text.objects.create(na_web = p.text)
t.save()
tn = TextNode.objects.create(text = t)
tn.save()
pn = PohadkaNode.objects.create(pohadka = p, first_child = tn)
pn.save()
class Migration(migrations.Migration):
dependencies = [
('seminar', '0058_problem_to_uloha_tema_clanek'),
]
operations = [
migrations.RunPython(vytvor_pohadkanode),
]

112
seminar/migrations/0060_spoj_stromy.py

@ -0,0 +1,112 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-29 03:26
from __future__ import unicode_literals
from django.db import migrations
from django.db.models import Q
def pridej_potomka(rodic, potomek):
# Daný vrchol bude posledním potomkem rodiče
uz_ma_deti = False
posledni = None
# Přidávaný potomek by neměl mít následovníka -- přidáváme potomka, ne podles.
if potomek.succ:
raise ValueError("Potomek má následovníka, to je velmi podezřelé!")
# Najdeme aktuálně posledního potomka:
if rodic.first_child:
uz_ma_deti = True
posledni = rodic.first_child
while posledni.succ:
posledni = posledni.succ
# Nastavíme kořen:
potomek.root = rodic.root
potomek.save()
# Připojíme vrchol:
if uz_ma_deti:
posledni.succ = potomek
posledni.save()
else:
rodic.first_child = potomek
rodic.save()
def pokacej_les(apps, schema_editor):
# Teď je potřeba všechny TreeNody příslušející k zadaným problémům připojit
# do hlavního stromu
# Tohle je jednoduchá verze: nejdřív témátka a seriály, pak úložky a pohádky,
# pak články a konfery, pak vzoráky, všechno setříděné podle kódu (FIXME?)
# Kopírování je častým zdrojem chyb!
Cislo = apps.get_model('seminar', 'Cislo')
Tema = apps.get_model('seminar', 'Tema')
Konfera = apps.get_model('seminar', 'Konfera')
Clanek = apps.get_model('seminar', 'Clanek')
Uloha = apps.get_model('seminar', 'Uloha')
Problem = apps.get_model('seminar', 'Problem')
Pohadka = apps.get_model('seminar', 'Pohadka')
for c in Cislo.objects.all().reverse():
cnode = c.cislonode
# Témata a seriály:
relevantni_temata = Tema.objects.filter(Q(cislo_zadani_old = c) | Q(cislo_reseni_old = c)).order_by('kod')
# Téma dáme do prvního čísla, kde se vyskytne
for t in relevantni_temata:
tnode = t.temavcislenode
if t.cislo_zadani_old and t.cislo_reseni_old:
assert(t.cislo_zadani_old <= t.cislo_reseni_old)
if t.cislo_reseni_old == c:
# Už by mělo být přidané do čísla zadání
continue
else:
# Patří sem (buď je to jediné číslo, nebo je to číslo zadání)
pridej_potomka(cnode, tnode)
# Úložky (zadání) a pohádky
for u in Uloha.objects.filter(cislo_zadani = c).order_by('kod'):
unode = u.ulohazadaninode
pohadky_pred = Pohadka.objects.filter(uloha_old = u.problem_ptr, pred = True)
pohadky_po = Pohadka.objects.filter(uloha_old = u.problem_ptr, pred = False)
for p in pohadky_pred:
pnode = p.pohadkanode
pridej_potomka(cnode, pnode)
pridej_potomka(cnode, unode)
for p in pohadky_po:
pnode = p.pohadkanode
pridej_potomka(cnode, pnode)
# Pohádky, které nejsou u úlohy jsou špatně:
if Pohadka.objects.exclude(uloha_old__typ='uloha').count():
raise ValueError("Existuje pohádka, která není u úlohy")
# Články
for cl in Clanek.objects.filter(cislo = c).order_by('kod'):
clnode = cl.claneknode
pridej_potomka(cnode, clnode)
# Konfery
for k in Konfera.objects.all():
knode = k.konferanode
if k.reseni and knode.root is None:
# Takováhle konfera nejspíš neexistuje
raise NotImplementedError("Konfery neumím zapojit do stromu")
# Vzoráky
for u in Uloha.objects.filter(cislo_reseni = c).order_by('kod'):
unode = u.ulohavzoraknode
pridej_potomka(cnode, unode)
class Migration(migrations.Migration):
dependencies = [
('seminar', '0059_vytvorit_pohadkanode'),
]
operations = [
migrations.RunPython(pokacej_les),
]

153
seminar/migrations/0061_kill_frankenstein.py

@ -0,0 +1,153 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-29 03:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('seminar', '0060_spoj_stromy'),
]
operations = [
migrations.RemoveField(
model_name='novinky',
name='autor_old',
),
migrations.RemoveField(
model_name='organizator',
name='foto',
),
migrations.RemoveField(
model_name='organizator',
name='organizuje_do_roku',
),
migrations.RemoveField(
model_name='organizator',
name='organizuje_od_roku',
),
migrations.RemoveField(
model_name='organizator',
name='prezdivka',
),
migrations.RemoveField(
model_name='organizator',
name='user',
),
migrations.RemoveField(
model_name='pohadka',
name='autor_old',
),
migrations.RemoveField(
model_name='pohadka',
name='uloha_old',
),
migrations.RemoveField(
model_name='problem',
name='autor_old',
),
migrations.RemoveField(
model_name='problem',
name='body',
),
migrations.RemoveField(
model_name='problem',
name='cislo_reseni_old',
),
migrations.RemoveField(
model_name='problem',
name='cislo_zadani_old',
),
migrations.RemoveField(
model_name='problem',
name='opravovatel',
),
migrations.RemoveField(
model_name='problem',
name='text_reseni',
),
migrations.RemoveField(
model_name='problem',
name='text_zadani',
),
migrations.RemoveField(
model_name='problem',
name='typ',
),
migrations.RemoveField(
model_name='reseni',
name='body',
),
migrations.RemoveField(
model_name='reseni',
name='cislo_body',
),
migrations.RemoveField(
model_name='reseni',
name='problem_old',
),
migrations.RemoveField(
model_name='reseni',
name='resitel',
),
migrations.RemoveField(
model_name='resitel',
name='datum_narozeni',
),
migrations.RemoveField(
model_name='resitel',
name='datum_prihlaseni',
),
migrations.RemoveField(
model_name='resitel',
name='datum_souhlasu_udaje',
),
migrations.RemoveField(
model_name='resitel',
name='datum_souhlasu_zasilani',
),
migrations.RemoveField(
model_name='resitel',
name='email',
),
migrations.RemoveField(
model_name='resitel',
name='jmeno',
),
migrations.RemoveField(
model_name='resitel',
name='mesto',
),
migrations.RemoveField(
model_name='resitel',
name='pohlavi_muz',
),
migrations.RemoveField(
model_name='resitel',
name='prijmeni',
),
migrations.RemoveField(
model_name='resitel',
name='psc',
),
migrations.RemoveField(
model_name='resitel',
name='stat',
),
migrations.RemoveField(
model_name='resitel',
name='telefon',
),
migrations.RemoveField(
model_name='resitel',
name='ulice',
),
migrations.RemoveField(
model_name='resitel',
name='user',
),
]

33
seminar/migrations/0062_redukce_modelu_pohadky.py

@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 01:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('seminar', '0061_kill_frankenstein'),
]
operations = [
migrations.AlterModelOptions(
name='pohadka',
options={'ordering': ['vytvoreno'], 'verbose_name': 'Pohádka', 'verbose_name_plural': 'Pohádky'},
),
migrations.RemoveField(
model_name='pohadka',
name='pred',
),
migrations.RemoveField(
model_name='pohadka',
name='text',
),
migrations.RemoveField(
model_name='pohadka',
name='uloha',
),
]

35
seminar/migrations/0063_procisteni_migraci.py

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-30 01:32
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('seminar', '0062_redukce_modelu_pohadky'),
]
operations = [
migrations.AlterField(
model_name='cislo',
name='verejna_vysledkovka',
# Změnil se help_text -- byly v něm tabulátory kvůli zlomu v modelech
field=models.BooleanField(default=False, help_text='Je-li false u veřejného čísla, není výsledkovka zatím veřejná.', verbose_name='zveřejněna výsledkovka'),
),
migrations.AlterField(
model_name='prijemce',
name='osoba',
# Bylo: ForeignKey
field=models.OneToOneField(help_text='Které osobě či na jakou adresu se mají zasílat čísla', on_delete=django.db.models.deletion.CASCADE, to='seminar.Osoba', verbose_name='komu'),
),
migrations.AlterField(
model_name='reseni',
name='cas_doruceni',
# Bylo: editable=False
field=models.DateTimeField(blank=True, default=django.utils.timezone.now, verbose_name='čas_doručení'),
),
]

162
seminar/migrations/0064_auto_20190610_2358.py

@ -0,0 +1,162 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.21 on 2019-06-10 21:58
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('seminar', '0063_procisteni_migraci'),
]
operations = [
migrations.AlterField(
model_name='cislo',
name='rocnik',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cisla', to='seminar.Rocnik', verbose_name='ročník'),
),
migrations.AlterField(
model_name='clanek',
name='cislo',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Cislo', verbose_name='číslo'),
),
migrations.AlterField(
model_name='hodnoceni',
name='cislo_body',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='hodnoceni', to='seminar.Cislo', verbose_name='číslo pro body'),
),
migrations.AlterField(
model_name='hodnoceni',
name='problem',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Problem', verbose_name='problém'),
),
migrations.AlterField(
model_name='konfery_ucastnici',
name='konfera',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='seminar.Konfera', verbose_name='konfera'),
),
migrations.AlterField(
model_name='konfery_ucastnici',
name='resitel',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Resitel', verbose_name='řešitel'),
),
migrations.AlterField(
model_name='nastaveni',
name='aktualni_cislo',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Cislo', verbose_name='poslední vydané číslo'),
),
migrations.AlterField(
model_name='nastaveni',
name='aktualni_rocnik',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Rocnik', verbose_name='aktuální ročník'),
),
migrations.AlterField(
model_name='novinky',
name='autor',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Organizator', verbose_name='Autor novinky'),
),
migrations.AlterField(
model_name='organizator',
name='osoba',
field=models.OneToOneField(help_text='osobní údaje organizátora', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='org', to='seminar.Osoba', verbose_name='osoba'),
),
migrations.AlterField(
model_name='osoba',
name='user',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='uživatel'),
),
migrations.AlterField(
model_name='pohadka',
name='autor',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Organizator', verbose_name='Autor pohádky'),
),
migrations.AlterField(
model_name='problem',
name='autor',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='autor_problemu_problem', to='seminar.Organizator', verbose_name='autor problému'),
),
migrations.AlterField(
model_name='problem',
name='garant',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='garant_problemu_problem', to='seminar.Organizator', verbose_name='garant zadaného problému'),
),
migrations.AlterField(
model_name='problem',
name='nadproblem',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='nadproblem_problem', to='seminar.Problem', verbose_name='nadřazený problém'),
),
migrations.AlterField(
model_name='reseni',
name='text_cely',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reseni_cely_set', to='seminar.Text', verbose_name='Plná verze textu řešení'),
),
migrations.AlterField(
model_name='reseni_resitele',
name='resitele',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Resitel', verbose_name='řešitel'),
),
migrations.AlterField(
model_name='resitel',
name='osoba',
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Osoba', verbose_name='osoba'),
),
migrations.AlterField(
model_name='resitel',
name='skola',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Skola', verbose_name='škola'),
),
migrations.AlterField(
model_name='skola',
name='kontaktni_osoba',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='seminar.Osoba', verbose_name='Kontaktní osoba'),
),
migrations.AlterField(
model_name='soustredeni',
name='rocnik',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='soustredeni', to='seminar.Rocnik', verbose_name='ročník'),
),
migrations.AlterField(
model_name='soustredeni_organizatori',
name='organizator',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Organizator', verbose_name='organizátor'),
),
migrations.AlterField(
model_name='soustredeni_organizatori',
name='soustredeni',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Soustredeni', verbose_name='soustředění'),
),
migrations.AlterField(
model_name='soustredeni_ucastnici',
name='resitel',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Resitel', verbose_name='řešitel'),
),
migrations.AlterField(
model_name='soustredeni_ucastnici',
name='soustredeni',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='seminar.Soustredeni', verbose_name='soustředění'),
),
migrations.AlterField(
model_name='tema',
name='rocnik',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='seminar.Rocnik', verbose_name='ročník'),
),
migrations.AlterField(
model_name='uloha',
name='cislo_deadline',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='deadlinove_ulohy', to='seminar.Cislo', verbose_name='číslo deadlinu'),
),
migrations.AlterField(
model_name='uloha',
name='cislo_reseni',
field=models.ForeignKey(blank=True, help_text='Číslo s řešením úlohy, jen pro úlohy', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='resene_ulohy', to='seminar.Cislo', verbose_name='číslo řešení'),
),
migrations.AlterField(
model_name='uloha',
name='cislo_zadani',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='zadane_ulohy', to='seminar.Cislo', verbose_name='číslo zadání'),
),
]

31
seminar/migrations/0065_treenode_polymorphic_ctype.py

@ -0,0 +1,31 @@
# Generated by Django 2.2.4 on 2019-08-13 19:36
from django.db import migrations, models
import django.db.models.deletion
def vyrob_treenodum_ctypes(apps, schema_editor):
# Kód zkopírovaný z dokumentace: https://django-polymorphic.readthedocs.io/en/stable/migrating.html
# XXX: Nevím, jestli se tohle náhodou nemělo spustit na všech childech (jen/i)
TreeNode = apps.get_model('seminar', 'TreeNode')
ContentType = apps.get_model('contenttypes', 'ContentType')
new_ct = ContentType.objects.get_for_model(TreeNode)
TreeNode.objects.filter(polymorphic_ctype__isnull=True).update(polymorphic_ctype=new_ct)
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('seminar', '0064_auto_20190610_2358'),
]
operations = [
migrations.AddField(
model_name='treenode',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_seminar.treenode_set+', to='contenttypes.ContentType'),
),
migrations.RunPython(vyrob_treenodum_ctypes, migrations.RunPython.noop),
]

29
seminar/migrations/0066_problem_polymorphic_ctype.py

@ -0,0 +1,29 @@
# Generated by Django 2.2.4 on 2019-08-13 19:45
from django.db import migrations, models
import django.db.models.deletion
def vyrob_problemum_ctypes(apps, schema_editor):
# Kód zkopírovaný z dokumentace: https://django-polymorphic.readthedocs.io/en/stable/migrating.html
# XXX: Nevím, jestli se tohle náhodou nemělo spustit na všech childech (jen/i)
Problem = apps.get_model('seminar', 'Problem')
ContentType = apps.get_model('contenttypes', 'ContentType')
new_ct = ContentType.objects.get_for_model(Problem)
Problem.objects.filter(polymorphic_ctype__isnull=True).update(polymorphic_ctype=new_ct)
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('seminar', '0065_treenode_polymorphic_ctype'),
]
operations = [
migrations.AddField(
model_name='problem',
name='polymorphic_ctype',
field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_seminar.problem_set+', to='contenttypes.ContentType'),
),
migrations.RunPython(vyrob_problemum_ctypes, migrations.RunPython.noop),
]

18
seminar/migrations/0067_auto_20190814_0805.py

@ -0,0 +1,18 @@
# Generated by Django 2.2.4 on 2019-08-14 06:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0066_problem_polymorphic_ctype'),
]
operations = [
migrations.AlterField(
model_name='konfera',
name='nazev',
field=models.CharField(help_text='Název konfery', max_length=100, verbose_name='název konfery'),
),
]

87
seminar/views.py

@ -10,6 +10,7 @@ from django.http import Http404,HttpResponseBadRequest,HttpResponseRedirect
from django.db.models import Q
from django.views.decorators.csrf import ensure_csrf_cookie
from django.contrib.auth import authenticate, login, get_user_model, logout
from django.contrib.auth.models import User
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db import transaction
from dal import autocomplete
@ -1012,83 +1013,75 @@ def logoutView(request):
return render(request, 'seminar/login.html', {'form': form})
def prihlaska_log_gdpr_safe(logger, gdpr_logger, msg, form_data):
msg = "{}, form_hash:{}".format(msg,hash(form_data))
logger.warn(msg)
gdpr_logger.warn(msg+", form:{}".format(form_data))
def prihlaskaView(request):
logger = logging.getLogger('seminar.prihlaska')
generic_logger = logging.getLogger('seminar.prihlaska')
err_logger = logging.getLogger('seminar.prihlaska.problem')
form_logger = logging.getLogger('seminar.prihlaska.form')
if request.method == 'POST':
form = PrihlaskaForm(request.POST)
# TODO vyresit, co se bude v jakych situacich zobrazovat
if form.is_valid():
print("Form valid")
try:
# mame jiz email v databazi?
o = Osoba.objects.get(email=form.cleaned_data['email'])
print("Email existuje: {}".format(form.cleaned_data))
# TODO seřvat a nepustit dál
return HttpResponseRedirect('/thanks/')
except ObjectDoesNotExist:
pass
User = get_user_model()
try:
u = User.objects.get(username=form.cleaned_data['username'])
print("Username existuje: {}".format(form.cleaned_data))
# TODO seřvat a nepustit dál
return HttpResponseRedirect('/thanks/')
except ObjectDoesNotExist:
pass
generic_logger.info("Form valid")
fcd = form.cleaned_data
form_hash = hash(fcd)
form_logger.info(fcd,form_hash=form_hash)
with transaction.atomic():
u = User.objects.create_user(
username=form.cleaned_data['username'],
password=form.cleaned_data['password'],
email = form.cleaned_data['email'])
username=fcd['username'],
password=fcd['password'],
email = fcd['email'])
u.save()
o = Osoba(
jmeno = form.cleaned_data['jmeno'],
prijmeni = form.cleaned_data['prijmeni'],
pohlavi_muz = form.cleaned_data['pohlavi_muz'],
email = form.cleaned_data['email'],
telefon = form.cleaned_data.get('telefon',''),
datum_narozeni = form.cleaned_data.get('datum_narozeni',None),
jmeno = fcd['jmeno'],
prijmeni = fcd['prijmeni'],
pohlavi_muz = fcd['pohlavi_muz'],
email = fcd['email'],
telefon = fcd.get('telefon',''),
datum_narozeni = fcd.get('datum_narozeni',None),
datum_souhlasu_udaje = date.today(),
datum_registrace = date.today(),
ulice = form.cleaned_data.get('ulice',''),
mesto = form.cleaned_data.get('mesto',''),
psc = form.cleaned_data.get('psc',''),
poznamka = str(form.cleaned_data)
ulice = fcd.get('ulice',''),
mesto = fcd.get('mesto',''),
psc = fcd.get('psc',''),
poznamka = str(fcd)
)
if form.cleaned_data.get('spam',False):
if fcd.get('spam',False):
o.datum_souhlasu_zasilani = date.today()
if form.cleaned_data.get('stat','') in ('CZ','SK'):
o.stat = form.cleaned_data['stat']
if fcd.get('stat','') in ('CZ','SK'):
o.stat = fcd['stat']
else:
pass
#TODO jak budeme resit jine staty?
# Unknown country - log it
msg = "Unknown country {}".format(fcd['stat_text'])
err_logger.warn(msg,form_hash=form_hash)
o.save()
o.user = u
o.save()
r = Resitel(
rok_maturity = form.cleaned_data['rok_maturity'],
zasilat = form.cleaned_data['zasilat']
rok_maturity = fcd['rok_maturity'],
zasilat = fcd['zasilat']
)
r.save()
r.osoba = o
if form.cleaned_data.get('skola'):
r.skola = form.cleaned_data['skola']
if fcd.get('skola'):
r.skola = fcd['skola']
else:
pass
#TODO doplnit skolu, kdyz neni v seznamu
# Unknown school - log it
msg = "Unknown school {}, {}".format(fcd['skola_nazev'],fcd['skola_adresa'])
err_logger.warn(msg,form_hash=form_hash)
r.save()
# TODO logovat jednotlive validni formulare do souboru
print(form.cleaned_data)
logger.info(form.cleaned_data)
return HttpResponseRedirect('/thanks/')
# if a GET (or any other method) we'll create a blank form

Loading…
Cancel
Save