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
50d962f0de
  1. 2
      .gitignore
  2. 4
      galerie/admin.py
  3. 0
      galerie/autocomplete_light_registry.py.old
  4. 2
      galerie/migrations/0001_initial.py
  5. 2
      korektury/migrations/0010_Pridani_odkazu_na_organizatora.py
  6. 2
      korektury/migrations/0014_add_org_to_pdf.py
  7. 19
      mamweb/settings_common.py
  8. 13
      mamweb/settings_debug.py
  9. 6
      mamweb/settings_local.py
  10. 24
      mamweb/static/css/mamweb.css
  11. BIN
      mamweb/static/images/header-bg-archiv-NOC.jpg
  12. BIN
      mamweb/static/images/header-bg-archiv.jpg
  13. BIN
      mamweb/static/images/header-bg-soustredeni-NOC.jpg
  14. BIN
      mamweb/static/images/header-bg-soustredeni.jpg
  15. BIN
      mamweb/static/images/header-bg-uvod-NOC.jpg
  16. BIN
      mamweb/static/images/header-bg-uvod.jpg
  17. BIN
      mamweb/static/images/header-bg-zadani.jpg
  18. 1
      mamweb/templates/admin/base_site.html
  19. 5
      mamweb/templates/base.html
  20. 1
      mamweb/urls.py
  21. 2
      prednasky/migrations/0001_initial.py
  22. 2
      prednasky/migrations/0005_auto_20160929_0153.py
  23. 3
      requirements.txt
  24. 117
      seminar/admin.py
  25. 0
      seminar/autocomplete_light_registry.py.old
  26. 90
      seminar/forms.py
  27. 20
      seminar/management/commands/nukedb.py
  28. 43
      seminar/management/commands/testdata.py
  29. 251
      seminar/migrations/0001_initial.py
  30. 670
      seminar/migrations/0001_reset.py
  31. 48
      seminar/migrations/0002_add_body_views.py
  32. 32
      seminar/migrations/0003_add_skola_zs_ss.py
  33. 44
      seminar/migrations/0004_add_old_dakos_id.py
  34. 21
      seminar/migrations/0005_alter_problem_autor.py
  35. 28
      seminar/migrations/0006_problem_add_timestamp.py
  36. 22
      seminar/migrations/0007_problem_zamereni.py
  37. 20
      seminar/migrations/0008_reseni_forma.py
  38. 47
      seminar/migrations/0009_rename_imported_IDs.py
  39. 20
      seminar/migrations/0010_alter_rok_maturity.py
  40. 39
      seminar/migrations/0011_alter_timestamp_def.py
  41. 18
      seminar/migrations/0012_remove_soustredeni_ucastnici.py
  42. 36
      seminar/migrations/0013_soustredeni_ucastnici_through_model.py
  43. 50
      seminar/migrations/0014_uprava_poznamek.py
  44. 20
      seminar/migrations/0015_soustredeni_text.py
  45. 42
      seminar/migrations/0016_texty_problemu.py
  46. 20
      seminar/migrations/0017_texty_problemu_minor.py
  47. 36
      seminar/migrations/0018_problemnavrh_problemzadany.py
  48. 32
      seminar/migrations/0019_rocnik_ciselne.py
  49. 44
      seminar/migrations/0020_indexy_a_razeni.py
  50. 20
      seminar/migrations/0021_cislo_verejna_vysledkovka.py
  51. 29
      seminar/migrations/0022_decimal_body.py
  52. 32
      seminar/migrations/0023_add_novinky.py
  53. 35
      seminar/migrations/0024_add_organizator.py
  54. 20
      seminar/migrations/0025_zmena_cesty_nahravani_obrazku.py
  55. 20
      seminar/migrations/0026_soustredeni_typ.py
  56. 32
      seminar/migrations/0027_export_flag_a_typ_akce.py
  57. 75
      seminar/migrations/0028_add_body_celkem_views.py
  58. 51
      seminar/migrations/0029_fix_body_celkem_views.py
  59. 60
      seminar/migrations/0030_add_vysledky.py
  60. 21
      seminar/migrations/0031_cislo_pdf.py
  61. 44
      seminar/migrations/0032_cislo_pdf_blank_typos.py
  62. 20
      seminar/migrations/0033_organizator_studuje_popisek.py
  63. 20
      seminar/migrations/0034_reseni_forma_default_email.py
  64. 25
      seminar/migrations/0035_django_imagekit.py
  65. 36
      seminar/migrations/0036_add_org_to_soustredeni.py
  66. 29
      seminar/migrations/0037_prispevek.py
  67. 18
      seminar/migrations/0038_change_meta_prispevek.py
  68. 34
      seminar/migrations/0039_pohadka.py
  69. 20
      seminar/migrations/0040_pohadka_nepovinny_autor.py
  70. 71
      seminar/migrations/0041_konfery.py
  71. 31
      seminar/migrations/0042_auto_20161005_0847.py
  72. 19
      seminar/migrations/0042_cislo_faze.py
  73. 19
      seminar/migrations/0043_uprava_faze.py
  74. 19
      seminar/migrations/0044_uprava_faze.py
  75. 19
      seminar/migrations/0045_cislo_pridani_faze_nahrano.py
  76. 15
      seminar/migrations/0046_merge.py
  77. 19
      seminar/migrations/0047_auto_20170120_2118.py
  78. 19
      seminar/migrations/0048_add_cislo_datum_deadline_soustredeni.py
  79. 508
      seminar/migrations/0049_auto_20190430_2354.py
  80. 191
      seminar/migrations/0050_auto_20190510_2228.py
  81. 89
      seminar/migrations/0051_resitel_to_osoba.py
  82. 82
      seminar/migrations/0052_user_to_organizator.py
  83. 36
      seminar/migrations/0053_organizator_organizuje_od_do.py
  84. 56
      seminar/migrations/0055_smazat_nemigrovane_zastarale_veci.py
  85. 47
      seminar/migrations/0056_vrcholy_pro_rocniky_a_cisla.py
  86. 34
      seminar/migrations/0057_reseni_to_reseni_hodnoceni.py
  87. 161
      seminar/migrations/0058_problem_to_uloha_tema_clanek.py
  88. 29
      seminar/migrations/0059_vytvorit_pohadkanode.py
  89. 112
      seminar/migrations/0060_spoj_stromy.py
  90. 153
      seminar/migrations/0061_kill_frankenstein.py
  91. 33
      seminar/migrations/0062_redukce_modelu_pohadky.py
  92. 35
      seminar/migrations/0063_procisteni_migraci.py
  93. 162
      seminar/migrations/0064_auto_20190610_2358.py
  94. 33
      seminar/models.py
  95. 32
      seminar/static/seminar/prihlaska.js
  96. 49
      seminar/templates/seminar/gdpr.html
  97. 33
      seminar/templates/seminar/login.html
  98. 115
      seminar/templates/seminar/prihlaska.html
  99. 4
      seminar/templates/seminar/prihlaska_field.html
  100. 17
      seminar/templates/seminar/resitel.html

2
.gitignore

@ -10,7 +10,7 @@
# aux files
*.pyc
*.swp
*.sw[mnop]
# secrets
/django.secret

4
galerie/admin.py

@ -5,7 +5,6 @@ from django.contrib import admin
from django.http import HttpResponseRedirect
from django import forms
from django.db import models
from autocomplete_light import shortcuts as autocomplete_light
# akction
@ -39,11 +38,12 @@ class GalerieInline(admin.TabularInline):
class ObrazekAdmin(admin.ModelAdmin):
list_display = ('obrazek_velky', 'nazev', 'popis', 'obrazek_maly_tag')
search_fields = ['nazev','popis']
class GalerieAdmin(admin.ModelAdmin):
form = autocomplete_light.modelform_factory(Galerie, autocomplete_fields=['titulni_obrazek'], fields=['titulni_obrazek'])
model = Galerie
fields = ('zobrazit', 'nazev', 'titulni_obrazek', 'popis', 'galerie_up', 'soustredeni', 'poradi')
autocomplete_fields = ['titulni_obrazek']
list_display = ('nazev', 'soustredeni', 'galerie_up', 'poradi', 'zobrazit', 'datum_zmeny')
inlines = [GalerieInline]
actions = [zverejnit_fotogalerii, prepnout_fotogalerii_do_org_rezimu]

0
galerie/autocomplete_light_registry.py → galerie/autocomplete_light_registry.py.old

2
galerie/migrations/0001_initial.py

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('seminar', '0033_organizator_studuje_popisek'),
('seminar', '0001_reset'),
]
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', '0041_konfery'),
('seminar', '0001_reset'),
('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', '0041_konfery'),
('seminar', '0001_reset'),
('korektury', '0013_rename_autor_org'),
]

19
mamweb/settings_common.py

@ -53,7 +53,7 @@ AUTHENTICATION_BACKENDS = (
MIDDLEWARE = (
'reversion.middleware.RevisionMiddleware',
# 'reversion.middleware.RevisionMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
@ -97,13 +97,14 @@ INSTALLED_APPS = (
# Utilities
'sekizai',
'reversion',
# 'reversion',
'django_countries',
'solo',
'ckeditor',
'ckeditor_uploader',
'taggit',
'autocomplete_light',
'dal',
'dal_select2',
'fluent_comments',
'crispy_forms',
@ -115,6 +116,8 @@ INSTALLED_APPS = (
'imagekit',
'polymorphic',
# MaMweb
'mamweb',
'seminar',
@ -212,6 +215,10 @@ LOGGING = {
'handlers': ['console'],
'level': 'DEBUG',
},
'seminar.prihlaska':{
'handlers': ['console','registration_logfile'],
'level': 'INFO'
},
# Catch-all logger
'': {
@ -234,6 +241,12 @@ LOGGING = {
'class': 'django.utils.log.AdminEmailHandler',
'formatter': 'verbose',
},
'registration_logfile':{
'level': 'INFO',
'class': 'logging.FileHandler',
'filename': 'registration.log',
'formatter': 'verbose',
}
},
}

13
mamweb/settings_debug.py

@ -0,0 +1,13 @@
# Debugovaci nastaveni settings.py
# Pro vyber tohoto nastaveni muzete pouzit tez:
# DJANGO_SETTINGS_MODULE=mamweb.settings_debug ./manage.py ...
# Import local settings
from .settings_local import *
# Vypisovani databazovych dotazu do konzole
LOGGING['loggers']['django.db.backends'] = {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
}

6
mamweb/settings_local.py

@ -72,12 +72,6 @@ LOGGING = {
},
},
'loggers': {
# Vypisovani databazovych dotazu do konzole
'django.db.backends': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
'': {
'handlers': ['console'],
'level': 'DEBUG',

24
mamweb/static/css/mamweb.css

@ -698,3 +698,27 @@ div.nahledy_cisel {
div.nahledy_cisel div, div.nahledy_cisel img {
position: absolute;
}
ul.form {
list-style-type: none;
padding-left: 0px;
}
label.field-label {
font-weight: normal;
}
label.field-required {
font-weight: bold;
}
.field-error {
font-size: 14px;
color: red;
}
ul.form li{
margin-bottom: 3px;
}
p.gdpr {
font-size: 6pt;
margin-bottom: .66em;
}
div.gdpr {
font-size: 6pt;
}

BIN
mamweb/static/images/header-bg-archiv-NOC.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 55 KiB

BIN
mamweb/static/images/header-bg-archiv.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 85 KiB

BIN
mamweb/static/images/header-bg-soustredeni-NOC.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 111 KiB

BIN
mamweb/static/images/header-bg-soustredeni.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 105 KiB

BIN
mamweb/static/images/header-bg-uvod-NOC.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 71 KiB

BIN
mamweb/static/images/header-bg-uvod.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 134 KiB

BIN
mamweb/static/images/header-bg-zadani.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 51 KiB

1
mamweb/templates/admin/base_site.html

@ -4,7 +4,6 @@
{% block extrahead %}
<link rel="shortcut icon" href="{% static 'favicon.ico' %}" type="image/x-icon">
<script src="{% static 'js/jquery-1.11.1.js' %}"></script>
{% include 'autocomplete_light/static.html' %}
{% endblock %}
{% block branding %}

5
mamweb/templates/base.html

@ -11,7 +11,6 @@
<link href="{% static 'css/mamweb.css' %}" rel="stylesheet">
<link href="{% static 'css/prettyPhoto.css' %}" rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
<script src="{% static 'js/jquery-1.11.1.js' %}"></script>
{% include 'autocomplete_light/static.html' %}
<link rel="stylesheet" type="text/css" href="{% static 'fluent_comments/css/ajaxcomments.css' %}" />
<script type="text/javascript" src="{% static 'fluent_comments/js/ajaxcomments.js' %}"></script>
@ -25,8 +24,8 @@
}
});
</script>
<script type="text/javascript"
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
{# script specifický pro stránku #}

1
mamweb/urls.py

@ -11,7 +11,6 @@ urlpatterns = [
# Admin a nastroje
path('admin/', admin.site.urls), # NOQA
path('ckeditor/', include('ckeditor_uploader.urls')),
path('autocomplete/', include('autocomplete_light.urls')),
# Seminarova aplikace (ma vlastni podadresare)
path('', include('seminar.urls')),

2
prednasky/migrations/0001_initial.py

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('seminar', '0036_add_org_to_soustredeni'),
('seminar', '0001_reset'),
]
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', '0041_konfery'),
('seminar', '0001_reset'),
('prednasky', '0004_remove_prednaska_seznam'),
]

3
requirements.txt

@ -22,9 +22,10 @@ django-solo
django-ckeditor
django-flat-theme
django-taggit
django-autocomplete-light==2.3.6
django-autocomplete-light
django-crispy-forms
django-imagekit
django-polymorphic
# Comments
akismet==1.0.1

117
seminar/admin.py

@ -1,5 +1,9 @@
from django.contrib import admin
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter
# Todo: reversion
import seminar.models as m
admin.site.register(m.Osoba)
@ -10,27 +14,110 @@ admin.site.register(m.Rocnik)
admin.site.register(m.Cislo)
admin.site.register(m.Organizator)
admin.site.register(m.Soustredeni)
admin.site.register(m.Problem)
admin.site.register(m.Tema)
admin.site.register(m.Clanek)
@admin.register(m.Problem)
class ProblemAdmin(PolymorphicParentModelAdmin):
base_model = m.Problem
child_models = [
m.Tema,
m.Clanek,
m.Uloha,
]
@admin.register(m.Tema)
class TemaAdmin(PolymorphicChildModelAdmin):
base_model = m.Tema
show_in_index = True
@admin.register(m.Clanek)
class ClanekAdmin(PolymorphicChildModelAdmin):
base_model = m.Clanek
show_in_index = True
@admin.register(m.Uloha)
class UlohaAdmin(PolymorphicChildModelAdmin):
base_model = m.Uloha
show_in_index = True
admin.site.register(m.Text)
admin.site.register(m.Uloha)
admin.site.register(m.Reseni)
admin.site.register(m.Hodnoceni)
admin.site.register(m.PrilohaReseni)
admin.site.register(m.Pohadka)
admin.site.register(m.Konfera)
admin.site.register(m.Obrazek)
admin.site.register(m.TreeNode)
admin.site.register(m.RocnikNode)
admin.site.register(m.CisloNode)
admin.site.register(m.MezicisloNode)
admin.site.register(m.TemaVCisleNode)
admin.site.register(m.KonferaNode)
admin.site.register(m.ClanekNode)
admin.site.register(m.UlohaZadaniNode)
admin.site.register(m.PohadkaNode)
admin.site.register(m.UlohaVzorakNode)
admin.site.register(m.TextNode)
# Polymorfismus pro stromy
# TODO: Inlines podle https://django-polymorphic.readthedocs.io/en/stable/admin.html
@admin.register(m.TreeNode)
class TreeNodeAdmin(PolymorphicParentModelAdmin):
base_model = m.TreeNode
child_models = [
m.RocnikNode,
m.CisloNode,
m.MezicisloNode,
m.TemaVCisleNode,
m.KonferaNode,
m.ClanekNode,
m.UlohaZadaniNode,
m.PohadkaNode,
m.UlohaVzorakNode,
m.TextNode,
]
@admin.register(m.RocnikNode)
class RocnikNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.RocnikNode
show_in_index = True
@admin.register(m.CisloNode)
class CisloNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.CisloNode
show_in_index = True
@admin.register(m.MezicisloNode)
class MezicisloNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.MezicisloNode
show_in_index = True
@admin.register(m.TemaVCisleNode)
class TemaVCisleNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.TemaVCisleNode
show_in_index = True
@admin.register(m.KonferaNode)
class KonferaNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.KonferaNode
show_in_index = True
@admin.register(m.ClanekNode)
class ClanekNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.ClanekNode
show_in_index = True
@admin.register(m.UlohaZadaniNode)
class UlohaZadaniNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.UlohaZadaniNode
show_in_index = True
@admin.register(m.PohadkaNode)
class PohadkaNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.PohadkaNode
show_in_index = True
@admin.register(m.UlohaVzorakNode)
class UlohaVzorakNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.UlohaVzorakNode
show_in_index = True
@admin.register(m.TextNode)
class TextNodeAdmin(PolymorphicChildModelAdmin):
base_model = m.TextNode
show_in_index = True
admin.site.register(m.Nastaveni)
admin.site.register(m.Novinky)

0
seminar/autocomplete_light_registry.py → seminar/autocomplete_light_registry.py.old

90
seminar/forms.py

@ -1,6 +1,92 @@
from django import forms
from dal import autocomplete
class NameForm(forms.Form):
your_name = forms.CharField(label='Your name', max_length=100)
from .models import Skola, Resitel
from datetime import date
class LoginForm(forms.Form):
username = forms.CharField(label='Přihlašovací jméno',
max_length=256,
required=True)
password = forms.CharField(
label='Heslo',
max_length=256,
required=True,
widget=forms.PasswordInput())
class PrihlaskaForm(forms.Form):
username = forms.CharField(label='Přihlašovací jméno',
max_length=256,
required=True,
help_text='Tímto jménem se následně budeš přihlašovat pro odevzdání řešení a další činnosti v semináři')
password = forms.CharField(
label='Heslo',
max_length=256,
required=True,
widget=forms.PasswordInput())
password_check = forms.CharField(
label='Ověření hesla',
max_length=256,
required=True,
widget=forms.PasswordInput())
jmeno = forms.CharField(label='Jméno', max_length=256, required=True)
prijmeni = forms.CharField(label='Příjmení', max_length=256, required=True)
pohlavi_muz = forms.ChoiceField(label='Pohlaví',
choices = ((True,'muž'),(False,'žena')), required=True)
email = forms.EmailField(label='E-mail',max_length=256, required=True)
telefon = forms.CharField(label='Telefon',max_length=256, required=False)
datum_narozeni = forms.DateField(label='Datum narození', required=False)
ulice = forms.CharField(label='Ulice', max_length=256, required=False)
mesto = forms.CharField(label='Město', max_length=256, required=False)
psc = forms.CharField(label='PSČ', max_length=32, required=False)
stat = forms.ChoiceField(label='Stát',
choices = (('CZ', 'Česká Republika'),
('SK', 'Slovenská Republika'),
('other', 'Jiné')),
required=False)
stat_text = forms.CharField(label='Stát', max_length=256, required=False)
skola = forms.ModelChoiceField(label="Škola",
queryset=Skola.objects.all(),
widget=autocomplete.ModelSelect2(
url='autocomplete_skola',
attrs = {'data-placeholder--id': '-1',
'data-placeholder--text' : '---',
'data-allow-clear': 'true'})
,required=False)
skola_nazev = forms.CharField(label='Název školy', max_length=256, required=False)
skola_adresa = forms.CharField(label='Adresa školy', max_length=256, required=False)
# trida = forms.CharField(label='Třída',max_length=10, required=True)
rok_maturity = forms.IntegerField(
label='Rok maturity',
min_value=date.today().year,
max_value=date.today().year+8,
required=True)
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(self):
super().clean()
data = self.cleaned_data
if data.get('password') != data.get('password_check'):
self.add_error('password_check',forms.ValidationError('Hesla se neshodují'))
if data.get('stat') != '' and data.get('stat_text') != '':
self.add_error('stat',forms.ValidationError('Nelze mít vybraný stát z menu a zároven zapsaný textem'))
if data.get('skola') and (data.get('skola_nazev') or data.get('skola_adresa')):
self.add_error('skola',forms.ValidationError('Pokud je škola v seznamu, nevypisujte ji ručně, pokud není, zrušte výběr ze seznamu (křížek vpravo)'))
if not data.get('skola'):
if data.get('skola_nazev')=='' and data.get('skola_adresa')=='':
self.add_error('skola',forms.ValidationError('Je nutné vyplnit školu'))
elif data.get('skola_nazev')=='':
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

20
seminar/management/commands/nukedb.py

@ -0,0 +1,20 @@
from mamweb.settings import INSTALLED_APPS
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
class Command(BaseCommand):
help = "Odmigruje všechny moduly (i.e. smaže všechny tabulky, ale databázi nechá)"
def add_arguments(self, parser):
# TODO: --force (makat a neblábolit)
pass
def handle(self, *args, **options):
# TODO: zeptat se
for app in INSTALLED_APPS:
app = app.split('.')[-1]
try:
call_command('migrate', app, 'zero')
except CommandError:
# app nemá migrace (aspoň typicky)
pass
call_command('showmigrations')

43
seminar/management/commands/testdata.py

@ -15,21 +15,34 @@ User = django.contrib.auth.get_user_model()
class Command(BaseCommand):
help = "Clear database and load testing data."
def handle(self, *args, **options):
assert settings.DEBUG == True
dbfile = settings.DATABASES['default']['NAME']
if os.path.exists(dbfile):
os.rename(dbfile, dbfile + '.old')
self.stderr.write('Stara databaze prejmenovana na "%s"' % (dbfile + '.old'))
call_command('migrate', no_input=True)
self.stdout.write('Vytvarim uzivatele "admin" (heslo "admin") a pseudo-nahodna data ...')
create_test_data(size=8)
self.stdout.write('Vytvoreno {} uzivatelu, {} skol, {} resitelu, {} rocniku, {} cisel,'
' {} problemu, {} reseni.'.format(User.objects.count(), Skola.objects.count(),
Resitel.objects.count(), Rocnik.objects.count(), Cislo.objects.count(),
Problem.objects.count(), Reseni.objects.count()))
help = "Clear database and load testing data."
def add_arguments(self, parser):
parser.add_argument(
'--no-clean',
action='store_true',
help='Změny se provedou v aktuální DB, ne v čisté. Aktuální DB se nezachová. (jen k debugování)',
)
parser.add_argument(
'--no-migrate',
action='store_true',
help='Neprovádět migrace před generováním testovacích dat (jen k debugování)',
)
def handle(self, *args, **options):
assert settings.DEBUG == True
dbfile = settings.DATABASES['default']['NAME']
if os.path.exists(dbfile) and not options['no_clean']:
os.rename(dbfile, dbfile + '.old')
self.stderr.write('Stara databaze prejmenovana na "%s"' % (dbfile + '.old'))
if not options['no_migrate']:
call_command('migrate', no_input=True)
self.stdout.write('Vytvarim uzivatele "admin" (heslo "admin") a pseudo-nahodna data ...')
create_test_data(size=8)
self.stdout.write('Vytvoreno {} uzivatelu, {} skol, {} resitelu, {} rocniku, {} cisel,'
' {} problemu, {} reseni.'.format(User.objects.count(), Skola.objects.count(),
Resitel.objects.count(), Rocnik.objects.count(), Cislo.objects.count(),
Problem.objects.count(), Reseni.objects.count()))

251
seminar/migrations/0001_initial.py

@ -1,251 +0,0 @@
# -*- 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

@ -0,0 +1,670 @@
# 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',),
),
]

48
seminar/migrations/0002_add_body_views.py

@ -1,48 +0,0 @@
# -*- 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

@ -1,32 +0,0 @@
# -*- 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

@ -1,44 +0,0 @@
# -*- 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

@ -1,21 +0,0 @@
# -*- 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

@ -1,28 +0,0 @@
# -*- 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

@ -1,22 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,47 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,39 +0,0 @@
# -*- 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

@ -1,18 +0,0 @@
# -*- 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

@ -1,36 +0,0 @@
# -*- 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

@ -1,50 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,42 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,36 +0,0 @@
# -*- 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

@ -1,32 +0,0 @@
# -*- 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

@ -1,44 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,29 +0,0 @@
# -*- 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

@ -1,32 +0,0 @@
# -*- 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

@ -1,35 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,32 +0,0 @@
# -*- 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

@ -1,75 +0,0 @@
# -*- 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

@ -1,51 +0,0 @@
# -*- 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

@ -1,60 +0,0 @@
# -*- 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

@ -1,21 +0,0 @@
# -*- 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

@ -1,44 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,25 +0,0 @@
# -*- 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

@ -1,36 +0,0 @@
# -*- 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

@ -1,29 +0,0 @@
# -*- 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

@ -1,18 +0,0 @@
# -*- 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

@ -1,34 +0,0 @@
# -*- 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

@ -1,20 +0,0 @@
# -*- 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

@ -1,71 +0,0 @@
# -*- 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

@ -1,31 +0,0 @@
# -*- 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

@ -1,19 +0,0 @@
# -*- 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

@ -1,19 +0,0 @@
# -*- 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

@ -1,19 +0,0 @@
# -*- 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

@ -1,19 +0,0 @@
# -*- 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

@ -1,15 +0,0 @@
# -*- 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

@ -1,19 +0,0 @@
# -*- 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

@ -1,19 +0,0 @@
# -*- 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

@ -1,508 +0,0 @@
# -*- 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

@ -1,191 +0,0 @@
# -*- 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

@ -1,89 +0,0 @@
# -*- 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

@ -1,82 +0,0 @@
# -*- 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

@ -1,36 +0,0 @@
# -*- 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

@ -1,56 +0,0 @@
# -*- 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

@ -1,47 +0,0 @@
# -*- 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

@ -1,34 +0,0 @@
# -*- 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

@ -1,161 +0,0 @@
# -*- 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

@ -1,29 +0,0 @@
# -*- 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

@ -1,112 +0,0 @@
# -*- 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

@ -1,153 +0,0 @@
# -*- 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

@ -1,33 +0,0 @@
# -*- 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

@ -1,35 +0,0 @@
# -*- 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

@ -1,162 +0,0 @@
# -*- 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í'),
),
]

33
seminar/models.py

@ -25,6 +25,7 @@ from seminar.utils import roman
from unidecode import unidecode
from polymorphic.models import PolymorphicModel
class SeminarModelBase(models.Model):
@ -583,7 +584,8 @@ class Soustredeni(SeminarModelBase):
@reversion.register(ignore_duplicates=True)
class Problem(SeminarModelBase):
# Pozor na následující řádek. *Nekrmit, asi kouše!*
class Problem(SeminarModelBase,PolymorphicModel):
class Meta:
# Není abstraktní, protože se na něj jinak nedají dělat ForeignKeys.
@ -1020,7 +1022,7 @@ class Konfera(models.Model):
# Interní ID
id = models.AutoField(primary_key = True)
nazev = models.CharField('název konfery', max_length=40, help_text = 'Název konfery')
nazev = models.CharField('název konfery', max_length=100, help_text = 'Název konfery')
anotace = models.TextField('anotace', blank=True,
help_text='Popis, o čem bude konfera.')
@ -1139,7 +1141,7 @@ class Obrazek(SeminarModelBase):
help_text = 'Černobílá verze obrázku do čísla',
upload_to = 'obrazky/%Y/%m/%d/', blank=True, null=True)
class TreeNode(models.Model):
class TreeNode(PolymorphicModel):
class Meta:
db_table = "seminar_nodes_treenode"
verbose_name = "TreeNode"
@ -1162,6 +1164,9 @@ class TreeNode(models.Model):
blank = True,
on_delete=models.SET_NULL,
verbose_name="další element na stejné úrovni")
nazev = models.TextField("název tohoto node",
help_text = "Tento název se zobrazuje v nabídkách pro výběr vhodného TreeNode",
blank=False, null=True)
def print_tree(self,indent=0):
print("{}TreeNode({})".format(" "*indent,self.id))
@ -1170,6 +1175,8 @@ class TreeNode(models.Model):
if self.succ:
self.succ.print_tree(indent=indent)
def __str__(self):
return self.nazev
class RocnikNode(TreeNode):
class Meta:
@ -1179,6 +1186,8 @@ class RocnikNode(TreeNode):
rocnik = models.OneToOneField(Rocnik,
on_delete = models.PROTECT, # Pokud chci mazat ročník, musím si Node pořešit ručně
verbose_name = "ročník")
def __str__(self):
return 'RocnikNode: '+str(self.rocnik)
class CisloNode(TreeNode):
class Meta:
@ -1188,12 +1197,16 @@ class CisloNode(TreeNode):
cislo = models.OneToOneField(Cislo,
on_delete = models.PROTECT, # Pokud chci mazat číslo, musím si Node pořešit ručně
verbose_name = "číslo")
def __str__(self):
return 'CisloNode: '+str(self.cislo)
class MezicisloNode(TreeNode):
class Meta:
db_table = 'seminar_nodes_mezicislo'
verbose_name = 'Mezičíslo (Node)'
verbose_name_plural = 'Mezičísla (Node)'
def __str__(self):
return 'MezicisloNode'
class TemaVCisleNode(TreeNode):
""" Obsahuje příspěvky k tématu v daném čísle """
@ -1204,6 +1217,8 @@ class TemaVCisleNode(TreeNode):
tema = models.ForeignKey(Tema,
on_delete=models.PROTECT, # Pokud chci mazat téma, musím si Node pořešit ručně
verbose_name = "téma v čísle")
def __str__(self):
return 'TemaVCisleNode: tema: '+str(self.tema)
class KonferaNode(TreeNode):
class Meta:
@ -1215,6 +1230,8 @@ class KonferaNode(TreeNode):
verbose_name = "konfera",
null=True,
blank=False)
def __str__(self):
return 'KonferaNode: '+str(self.konfera)
class ClanekNode(TreeNode):
class Meta:
@ -1226,6 +1243,8 @@ class ClanekNode(TreeNode):
verbose_name = "článek",
null=True,
blank=False)
def __str__(self):
return 'ClanekNode: '+str(self.clanek)
class UlohaZadaniNode(TreeNode):
class Meta:
@ -1237,6 +1256,8 @@ class UlohaZadaniNode(TreeNode):
verbose_name = "úloha",
null=True,
blank=False)
def __str__(self):
return 'UlohaZadaniNode: '+str(self.uloha)
class PohadkaNode(TreeNode):
class Meta:
@ -1247,6 +1268,8 @@ class PohadkaNode(TreeNode):
on_delete=models.PROTECT, # Pokud chci mazat pohádku, musím si Node pořešit ručně
verbose_name = "pohádka",
)
def __str__(self):
return 'PohadkaNode: '+str(self.pohadka)
class UlohaVzorakNode(TreeNode):
class Meta:
@ -1258,6 +1281,8 @@ class UlohaVzorakNode(TreeNode):
verbose_name = "úloha",
null=True,
blank=False)
def __str__(self):
return 'UlohaVzorakNode: '+str(self.uloha)
class TextNode(TreeNode):
class Meta:
@ -1267,6 +1292,8 @@ class TextNode(TreeNode):
text = models.ForeignKey(Text,
on_delete=models.PROTECT,
verbose_name = 'text')
def __str__(self):
return 'TextNode: '+str(self.text)
## FIXME: Logiku přesunout do views.
#class VysledkyBase(SeminarModelBase):

32
seminar/static/seminar/prihlaska.js

@ -0,0 +1,32 @@
function addrCountryChanged(){
var stat_select = document.getElementById('id_stat');
var stat_text = document.getElementById('id_li_stat_text');
var stat = stat_select[stat_select.selectedIndex].value;
if (stat === "other"){
stat_text.style.display="block";
} else {
stat_text.style.display="none";
$('#id_stat_text').val("");
}
}
function hideSchoolTextfields(){
var skola_nazev = document.getElementById('id_li_skola_nazev');
var skola_adresa = document.getElementById('id_li_skola_adresa');
skola_nazev.style.display="none";
skola_adresa.style.display="none";
}
function schoolNotInList(){
var skola_nazev = document.getElementById('id_li_skola_nazev');
var skola_adresa = document.getElementById('id_li_skola_adresa');
// FIXME nefunguje a nevim proc (TypeError: $(...).select2 is not a function)
//var skola_select = $('#id_skola').select2();
//skola_select.val(null).trigger('change');
skola_nazev.style.display="block";
skola_adresa.style.display="block";
}
document.addEventListener("DOMContentLoaded", function(){
addrCountryChanged();
hideSchoolTextfields();
});

49
seminar/templates/seminar/gdpr.html

@ -0,0 +1,49 @@
<p>
TL;DR:
K tomu, abychom mohli zpracovávat Tvá data (uložit si tvou adresu, zobrazit Tvé jméno ve výsledkové listině, opravit Tvá řešení) od Tebe potřebujeme souhlas.
Pokud se zpracováváním souhlasíš dle níže uvedených podmínek, zaškrtni políčko níže.
</p>
<div class="gdpr">
<p class="gdpr">
Získáváme od Tebe údaje vyplněné v přihlášce do semináře (jméno, příjmení, poštovní a e-mailovou adresu, školu, kterou navštěvuješ a rok maturity), případně v přihlášce na soustředění (navíc datum narození, telefonní číslo). Také uchováváme všechna řešení, která nám pošleš, a jejich hodnocení.
</p>
<p class="gdpr">
Slibujeme Ti, že Tvá osobní data nezneužijeme k ničemu, co by nesouviselo s M&amp;M nebo s dalšími aktivitami Matfyzu, a nikdy je nepředáme nikomu cizímu. Údaje využíváme k zajištění chodu semináře a také je sdílíme s ostatními propagačními akcemi Matfyzu, abychom mohli vyhodnocovat úspěšnost akcí. Pokud budeš mít zájem, budeme Ti také posílat zajímavé zprávy a novinky týkajíci se Matfyzu.
</p>
<p class="gdpr">
Veřejně vystavujeme pouze výsledkové listiny, které také uchováváme pro archivní účely. Pokud ale z nějakého důvodu nebudeš chtít mít své jméno či školu uvedené ve výsledkové listině, není problém to zařídit, napiš nám. Z tištěných materiálů samozřejmě údaje už odstranit nemůžeme.
</p>
<p class="gdpr">
Na soustředěních a dalších akcích semináře navíc pořizujeme fotografie a videozáznamy a používáme je ke zpravodajským a propagačním účelům. Pro propagační účely si od Tebe vyžádáme samostatný souhlas na začátku akce.
</p>
<p class="gdpr">
<i>Souhlas se zpracováním osobních údajů pro potřeby chodu semináře</i>
</p>
<p class="gdpr">
Tímto uděluji souhlas Univerzitě Karlově, se sídlem Ovocný trh 560/5, 116 36 Praha 1, IČO 00216208 (dále jen UK), která je správcem osobních údajů všech fakult a součástí UK, ke zpracování osobních údajů pro potřeby Korespondenčního semináře M&amp;M a Matematicko-fyzikální fakulty UK (dále jen M&amp;M a MFF UK).
</p>
<p class="gdpr">
Tento souhlas uděluji pro všechny výše uvedené osobní údaje, a to po dobu účasti v semináři a 10 let poté, a dále souhlasím s uchováváním potřebných dat pro archivní účely i po této lhůtě (vystavené výsledkové listiny aj.).
</p>
<p class="gdpr">
MFF UK tyto údaje zpracovává za účelem evidence řešitelů a účastníků M&amp;M, k zajištění celoročního fungování semináře, analýze účinnosti jednotlivých propagačních akcí MFF UK a zpravodajským účelům. Osobám, které o to projeví zájem v nastavení svého účtu, bude MFF UK také zasílat propagační materiály.
</p>
<p class="gdpr">
Údaje nebudou předány třetí osobě ani využívány k jiným účelům, než ke kterým byly poskytnuty.
</p>
<p class="gdpr">
Tento souhlas uděluji ze své vlastní a svobodné vůle a beru na vědomí, že jej mohu kdykoliv odvolat zasláním e-mailu na adresu mam@matfyz.cz. Stejně tak může být požadováno vymazání i z archivních údajů M&M, pokud to bude technicky možné. Beru na vědomí, že údaje z tištěných publikací není možné zpětně odstranit.
</p>
<p class="gdpr">
Dále máte právo:
<ul>
<li>požádat o informaci, jaké osobní údaje jsou o vás zpracovávány,
<li>požadovat opravu osobních údajů, pokud jsou neplatné nebo zastaralé,
<li>požadovat, aby nebyly vaše osobní údaje zpracovávány do doby, než bude vyřešena oprávněnost výše uvedených požadavků,
<li>požadovat, aby byly vaše osobní údaje předány jinému správci,
<li>podat stížnost u dozorového úřadu.
</p>
<p class="gdpr">
V případě jakéhokoliv dotazu nebo uplatnění svých práv můžete kontaktovat pověřence pro ochranu osobních údajů na e-mailové adrese gdpr@cuni.cz.
</p>
</div>

33
seminar/templates/seminar/login.html

@ -0,0 +1,33 @@
{% extends "seminar/zadani/base.html" %}
{% load staticfiles %}
{% block content %}
<h1>
{% block nadpis1a %}{% block nadpis1b %}
Přihlášení
{% endblock %}{% endblock %}
</h1>
{% if login_error %}
<span class="field_error">{{login_error}}<span>
{% endif %}
<form action="{% url 'login' %}" method="post">
{% csrf_token %}
{{form.non_field_errors}}
<ul class="form">
<li>
{% include "seminar/prihlaska_field.html" with field=form.username %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.password %}
</li>
</ul>
<input type="submit" value="Přihlásit">
</form>
<a href="{% url 'reset_password' %}">Zapomněl jsem heslo</a><br>
<a href="{% url 'seminar_prihlaska' %}">Zaregistrovat</a><br>
{% endblock %}

115
seminar/templates/seminar/prihlaska.html

@ -1,5 +1,112 @@
<form action="/prihlaska/" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
{% extends "seminar/zadani/base.html" %}
{% load staticfiles %}
{% block script %}
<!--script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.js' %}"></script!-->
{{form.media}}
<script src="{% static 'seminar/prihlaska.js' %}"></script>
{% endblock %}
{% block content %}
<h1>
{% block nadpis1a %}{% block nadpis1b %}
Přihláška do semináře
{% endblock %}{% endblock %}
</h1>
<form action="{% url 'seminar_prihlaska' %}" method="post">
{% csrf_token %}
{{form.non_field_errors}}
<ul class="form">
<li>
Přihlašovací údaje
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.username %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.password %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.password_check %}
</li>
<li>
Osobní údaje
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.jmeno %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.prijmeni %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.pohlavi_muz%}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.email %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.telefon %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.datum_narozeni %}
</li>
<li>
<hr>
Bydliště
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.ulice %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.mesto %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.psc %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.stat %}
</li>
<li id="id_li_stat_text">
{% include "seminar/prihlaska_field.html" with field=form.stat_text %}
</li>
<li>
<hr>
{% include "seminar/prihlaska_field.html" with field=form.skola %}
</li>
<li>
<button id="id_skola_text_button" type="button">Škola není v seznamu</button>
</li>
<li id="id_li_skola_nazev">
Vyplň prosím celý název a adresu školy.<br>
{% include "seminar/prihlaska_field.html" with field=form.skola_nazev %}
</li>
<li id="id_li_skola_adresa">
{% include "seminar/prihlaska_field.html" with field=form.skola_adresa %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.rok_maturity %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.zasilat %}
</li>
<li>
{% include "seminar/gdpr.html" %}
{% include "seminar/prihlaska_field.html" with field=form.gdpr %}
</li>
<li>
{% include "seminar/prihlaska_field.html" with field=form.spam %}
</li>
</ul>
<input type="submit" value="Odeslat">
</form>
<script>
$("#id_stat").on("change",addrCountryChanged);
$("#id_skola_text_button").on("click",schoolNotInList);
</script>
{% endblock %}

4
seminar/templates/seminar/prihlaska_field.html

@ -0,0 +1,4 @@
<label class="field-label{% if field.field.required %} field-required{% endif %}" for="{{ field.id_for_label }}">{{ field.label }}:</label>
{{field}}
{% if field.help_text %}<span class="field-helptext">{{ field.help_text|safe }}</span>{% endif %}
{% if field.errors %}<span class="field-error">{{ field.errors }}</span>{% endif %}

17
seminar/templates/seminar/resitel.html

@ -0,0 +1,17 @@
{% extends "seminar/zadani/base.html" %}
{% load staticfiles %}
{% block content %}
<h1>
{% block nadpis1a %}{% block nadpis1b %}
Stránka řešitele - {{ object.osoba.jmeno }} {{ object.osoba.prijmeni }}
{% endblock %}{% endblock %}
</h1>
<a href="{% url 'logout' %}">Odhlásit se</a><br>
<a href="{% url 'seminar_resitel_edit' %}">Upravit údaje</a><br>
{% endblock %}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save