@ -0,0 +1,187 @@ |
|||||
|
Jak zvládnout migrace na nový model: |
||||
|
|
||||
|
- V mojí verzi databáze mají úlohy-Problémy typ "b'uloha'" |
||||
|
|
||||
|
|
||||
|
Log migrace na nový model: |
||||
|
|
||||
|
Operations to perform: |
||||
|
Apply all migrations: admin, auth, contenttypes, django_comments, flatpages, fluent_comments, galerie, korektury, prednasky, reversion, seminar, sessions, sites, sitetree, taggit, threadedcomments |
||||
|
Running migrations: |
||||
|
Applying admin.0003_logentry_add_action_flag_choices... OK |
||||
|
Applying auth.0009_alter_user_last_name_max_length... OK |
||||
|
Applying auth.0010_alter_group_name_max_length... OK |
||||
|
Applying auth.0011_update_proxy_permissions... OK |
||||
|
Applying galerie.0008_auto_20190430_2340... OK |
||||
|
Applying galerie.0009_auto_20190610_2358... OK |
||||
|
Applying galerie.0010_auto_20200819_0947... OK |
||||
|
Applying korektury.0016_auto_20190430_2340... OK |
||||
|
Applying korektury.0017_auto_20190610_2358... OK |
||||
|
Applying prednasky.0011_auto_20190430_2340... OK |
||||
|
Applying prednasky.0012_auto_20190610_2358... OK |
||||
|
Applying seminar.0049_auto_20190430_2354... OK |
||||
|
Applying seminar.0050_auto_20190510_2228... OK |
||||
|
Applying seminar.0051_resitel_to_osoba... OK |
||||
|
Applying seminar.0052_user_to_organizator... OK |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2004-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1998-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2017-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2017-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2014-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2011-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2013-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2004-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2013-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2012-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2007-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2011-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2009-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2009-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2008-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2005-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2015-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2001-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2010-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2008-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2006-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2002-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2005-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1999-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2003-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2000-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2002-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2001-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1996-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2000-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (1999-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (1996-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1994-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2012-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2016-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2018-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2014-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2019-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2006-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (1995-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_do received a naive datetime (2007-12-31 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2015-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2016-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2018-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2019-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
/aux/akce/mam/www/mamweb-test/env/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1427: RuntimeWarning: DateTimeField Organizator.organizuje_od received a naive datetime (2020-01-01 00:00:00) while time zone support is active. |
||||
|
RuntimeWarning) |
||||
|
Applying seminar.0053_organizator_organizuje_od_do... OK |
||||
|
Applying seminar.0055_smazat_nemigrovane_zastarale_veci... OK |
||||
|
Applying seminar.0056_vrcholy_pro_rocniky_a_cisla... OK |
||||
|
Applying seminar.0057_reseni_to_reseni_hodnoceni...!!!!!!!!!!!!!!! |
||||
|
31397 Reseni object (31397) |
||||
|
!!!!!!!!!!!!!!! |
||||
|
!!!!!!!!!!!!!!! |
||||
|
31396 Reseni object (31396) |
||||
|
!!!!!!!!!!!!!!! |
||||
|
!!!!!!!!!!!!!!! |
||||
|
31395 Reseni object (31395) |
||||
|
!!!!!!!!!!!!!!! |
||||
|
!!!!!!!!!!!!!!! |
||||
|
31394 Reseni object (31394) |
||||
|
!!!!!!!!!!!!!!! |
||||
|
!!!!!!!!!!!!!!! |
||||
|
31393 Reseni object (31393) |
||||
|
!!!!!!!!!!!!!!! |
||||
|
OK |
||||
|
Applying seminar.0058_problem_to_uloha_tema_clanek... OK |
||||
|
Applying seminar.fix_0058... OK |
||||
|
Applying seminar.0059_vytvorit_pohadkanode... OK |
||||
|
Applying seminar.0060_spoj_stromy... OK |
||||
|
Applying seminar.0061_kill_frankenstein... OK |
||||
|
Applying seminar.0062_redukce_modelu_pohadky... OK |
||||
|
Applying seminar.0063_procisteni_migraci... OK |
||||
|
Applying seminar.0064_auto_20190610_2358... OK |
||||
|
Applying seminar.0065_treenode_polymorphic_ctype... OK |
||||
|
Applying seminar.0066_problem_polymorphic_ctype... OK |
||||
|
Applying seminar.0067_auto_20190814_0805... OK |
||||
|
Applying seminar.0068_treenode_nazev... OK |
||||
|
Applying seminar.0069_auto_20191120_2115... OK |
||||
|
Applying seminar.0070_auto_20191120_2357... OK |
||||
|
Applying seminar.0071_remove_nastaveni_aktualni_rocnik... OK |
||||
|
Applying seminar.0072_auto_20191204_2257... OK |
||||
|
Applying seminar.0073_copy_osoba_email_to_user_email... OK |
||||
|
Applying seminar.0074_auto_20200228_1401... OK |
||||
|
Applying seminar.0075_auto_20200228_2010... OK |
||||
|
Applying seminar.0076_auto_20200228_2013... OK |
||||
|
Applying seminar.0077_auto_20200318_2146... OK |
||||
|
Applying seminar.0078_otistenereseninode... OK |
||||
|
Applying seminar.0079_clanek_resitelsky... OK |
||||
|
Applying seminar.0080_zruseni_claneknode_a_konferanode... OK |
||||
|
Applying seminar.0081_auto_20200408_2221... OK |
||||
|
Applying seminar.0082_auto_20200506_1951... OK |
||||
|
Applying seminar.0083_auto_20200506_1952... OK |
||||
|
WARNING 2020-08-20 00:49:07,941 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2215) |
||||
|
WARNING 2020-08-20 00:49:07,953 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2221) |
||||
|
WARNING 2020-08-20 00:49:07,959 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2212) |
||||
|
WARNING 2020-08-20 00:49:07,965 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1955) |
||||
|
WARNING 2020-08-20 00:49:07,968 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2027) |
||||
|
WARNING 2020-08-20 00:49:07,971 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1981) |
||||
|
WARNING 2020-08-20 00:49:07,974 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1970) |
||||
|
WARNING 2020-08-20 00:49:07,978 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2001) |
||||
|
WARNING 2020-08-20 00:49:07,981 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2004) |
||||
|
WARNING 2020-08-20 00:49:07,984 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1941) |
||||
|
WARNING 2020-08-20 00:49:07,990 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2024) |
||||
|
WARNING 2020-08-20 00:49:07,993 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2031) |
||||
|
WARNING 2020-08-20 00:49:07,997 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2211) |
||||
|
WARNING 2020-08-20 00:49:08,005 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2073) |
||||
|
WARNING 2020-08-20 00:49:08,017 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2018) |
||||
|
WARNING 2020-08-20 00:49:08,022 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2222) |
||||
|
WARNING 2020-08-20 00:49:08,028 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (1953) |
||||
|
WARNING 2020-08-20 00:49:08,034 0084_clanek_cislo: Více než jedno řešení pro článek Clanek object (2026) |
||||
|
Applying seminar.0084_clanek_cislo... OK |
||||
|
Applying seminar.0085_nepovinna_prezdivka... OK |
||||
|
Applying seminar.0086_auto_20200819_0959... OK |
||||
|
Applying sitetree.0001_initial... OK |
||||
|
Applying taggit.0003_taggeditem_add_unique_index... OK |
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
# Generated by Django 2.2.15 on 2020-08-19 07:47 |
||||
|
|
||||
|
from django.db import migrations, models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('galerie', '0009_auto_20190610_2358'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterField( |
||||
|
model_name='galerie', |
||||
|
name='poradi', |
||||
|
field=models.IntegerField(blank=True, default=0, verbose_name='Pořadí'), |
||||
|
), |
||||
|
] |
@ -1,13 +1,14 @@ |
|||||
# coding: utf-8 |
# coding: utf-8 |
||||
|
|
||||
from django.urls import path |
from django.urls import path |
||||
|
from seminar.utils import org_required |
||||
from . import views |
from . import views |
||||
|
|
||||
urlpatterns = [ |
urlpatterns = [ |
||||
path('<int:pk>/', views.nahled), |
path('<int:pk>/', views.nahled), |
||||
path('<int:pk>/<int:fotka>/', views.detail), |
path('<int:pk>/<int:fotka>/', views.detail), |
||||
path('<int:galerie>/new/', views.new_galerie), |
path('<int:galerie>/new/', org_required(views.new_galerie)), |
||||
path('<int:galerie>/plus/<int:subgalerie>/', views.plus_galerie), |
path('<int:galerie>/plus/<int:subgalerie>/', org_required(views.plus_galerie)), |
||||
path('<int:galerie>/minus/<int:subgalerie>/', views.minus_galerie), |
path('<int:galerie>/minus/<int:subgalerie>/', org_required(views.minus_galerie)), |
||||
] |
] |
||||
|
|
||||
|
@ -0,0 +1,13 @@ |
|||||
|
{% with "/korektury" as cesta %} |
||||
|
|
||||
|
<div id='submenu'> |
||||
|
<ul> |
||||
|
<li class="{% if selected == "aktualni" %}selected{% endif %}"><a href="{{cesta}}/">Aktuální</a> |
||||
|
<li class="{% if selected == "zastarale" %}selected{% endif %}"><a href="{{cesta}}/zastarale/">Zastaralé</a> |
||||
|
<li class="{% if selected == "help" %}selected{% endif %}"><a href="{{cesta}}/help/">Nápověda</a> |
||||
|
</ul> |
||||
|
</div> |
||||
|
|
||||
|
{% endwith %} |
||||
|
|
||||
|
|
@ -0,0 +1,69 @@ |
|||||
|
import logging |
||||
|
import os |
||||
|
from shutil import copyfile, rmtree |
||||
|
|
||||
|
from django.db import transaction |
||||
|
from django.conf import settings |
||||
|
|
||||
|
from korektury.models import KorekturovanePDF, generate_filename |
||||
|
|
||||
|
logger = logging.getLogger(__name__) |
||||
|
|
||||
|
@transaction.atomic |
||||
|
def create_test_pdf(rnd, organizatori): |
||||
|
logger.info('Vyrábím testovací pdf ke korekturovani') |
||||
|
try: |
||||
|
testpdfs = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'testpdfs') |
||||
|
|
||||
|
# smaže minulé pdfka a obrázky k nim a vytvoří (znovu) jejich složky |
||||
|
pdf_dir = os.path.join(settings.BASE_DIR, os.path.join('media', settings.KOREKTURY_PDF_DIR)) |
||||
|
img_dir = os.path.join(settings.BASE_DIR, os.path.join('media', settings.KOREKTURY_IMG_DIR)) |
||||
|
rmtree(pdf_dir, ignore_errors=True) |
||||
|
os.makedirs(pdf_dir) |
||||
|
rmtree(img_dir, ignore_errors=True) |
||||
|
os.makedirs(img_dir) |
||||
|
|
||||
|
def gen_filename(filename): |
||||
|
name = generate_filename(None, filename) |
||||
|
print(name) |
||||
|
copyfile(os.path.join(testpdfs, filename), os.path.join(settings.BASE_DIR, os.path.join('media', name))) |
||||
|
return name |
||||
|
|
||||
|
# TODO silent ghostscript (vypisuje odstavec za každou stránku…) |
||||
|
|
||||
|
KorekturovanePDF.objects.create( |
||||
|
nazev='B', komentar='Neuronové sítě', org=rnd.choice(organizatori), pdf=gen_filename(filename='B.pdf') |
||||
|
) |
||||
|
|
||||
|
KorekturovanePDF.objects.create( |
||||
|
nazev='A', komentar='M&M: Jak řešit?', org=rnd.choice(organizatori), pdf=gen_filename(filename='A.pdf') |
||||
|
) |
||||
|
|
||||
|
korekturovane_pdf = KorekturovanePDF.objects.create( |
||||
|
nazev='A', komentar='M&M: Jak řešit?', org=rnd.choice(organizatori), pdf=gen_filename(filename='A.pdf'), |
||||
|
status='zanaseni' |
||||
|
) |
||||
|
|
||||
|
KorekturovanePDF.objects.create( |
||||
|
nazev='A', komentar='M&M: Jak řešit?', org=rnd.choice(organizatori), pdf=gen_filename(filename='A.pdf'), |
||||
|
status='zastarale' |
||||
|
) |
||||
|
except (FileNotFoundError, Exception) as e: |
||||
|
# TODO najít správné chyby, které vyhazují různé systémy při neexistenci ImageMagick, nebo knihoven |
||||
|
logger.error(str(e)) |
||||
|
logger.error( |
||||
|
'Chyba vytváření testovacích korektur, pravděpodobně není nainstalován ImageMagick nebo některá z knihoven' |
||||
|
'pro práci se soubory pdf (ghostscript) nebo png (libpng?).\n' |
||||
|
''' |
||||
|
Instalaci na linux provedete např. příkazy: |
||||
|
sudo apt-get build-dep imagemagick |
||||
|
git clone https://github.com/ImageMagick/ImageMagick.git |
||||
|
cd ImageMagick/ |
||||
|
./configure |
||||
|
make |
||||
|
sudo make install |
||||
|
sudo ldconfig /usr/local/lib |
||||
|
cd .. |
||||
|
rm -r ImageMagick/ |
||||
|
''' |
||||
|
) |
@ -1,11 +1,10 @@ |
|||||
from django.urls import path |
from django.urls import path |
||||
from django.contrib.auth.decorators import user_passes_test |
from seminar.utils import org_required |
||||
from . import views |
from . import views |
||||
|
|
||||
staff_member_required = user_passes_test(lambda u: u.is_staff) |
|
||||
|
|
||||
urlpatterns = [ |
urlpatterns = [ |
||||
path('korektury/', staff_member_required(views.KorekturyListView.as_view()), name='korektury-list'), |
path('korektury/', org_required(views.KorekturyAktualniListView.as_view()), name='korektury-list'), |
||||
path('korektury/<int:pdf>/', staff_member_required(views.KorekturyView.as_view()), name='korektury'), |
path('korektury/zastarale/', org_required(views.KorekturyZastaraleListView.as_view()), name='korektury-list'), |
||||
path('korektury/help/', staff_member_required(views.KorekturyHelpView.as_view()), name='korektury-help'), |
path('korektury/<int:pdf>/', org_required(views.KorekturyView.as_view()), name='korektury'), |
||||
|
path('korektury/help/', org_required(views.KorekturyHelpView.as_view()), name='korektury-help'), |
||||
] |
] |
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,26 @@ |
|||||
|
{% load staticfiles %} |
||||
|
<img class="logo" |
||||
|
{% for item in sitetree_items %} |
||||
|
{% if item.is_active or item.in_current_branch %} |
||||
|
{% if forloop.counter == 1 %} |
||||
|
src="{% static 'images/logo_1.svg' %}" |
||||
|
{% endif %} |
||||
|
{% if forloop.counter == 2 %} |
||||
|
src="{% static 'images/logo_2.svg' %}" |
||||
|
{% endif %} |
||||
|
{% if forloop.counter == 3 %} |
||||
|
src="{% static 'images/logo_3.svg' %}" |
||||
|
{% endif %} |
||||
|
{% if forloop.counter == 4 %} |
||||
|
src="{% static 'images/logo_4.svg' %}" |
||||
|
{% endif %} |
||||
|
{% if forloop.counter == 5 %} |
||||
|
src="{% static 'images/logo_5.svg' %}" |
||||
|
{% endif %} |
||||
|
{% if forloop.counter == 6 %} |
||||
|
src="{% static 'images/logo_6.svg' %}" |
||||
|
{% endif %} |
||||
|
{% endif %} |
||||
|
{% endfor %} |
||||
|
src="{% static 'images/logo.svg' %}" |
||||
|
/> |
@ -1,14 +1,25 @@ |
|||||
from django.urls import path |
from django.urls import path |
||||
from django.contrib.auth.decorators import user_passes_test |
from seminar.utils import org_required, resitel_required |
||||
from . import views |
from . import views |
||||
|
|
||||
staff_member_required = user_passes_test(lambda u: u.is_staff) |
|
||||
|
|
||||
urlpatterns = [ |
urlpatterns = [ |
||||
path('prednasky/', views.newPrednaska), |
path( |
||||
|
'prednasky/', |
||||
|
resitel_required(views.newPrednaska) |
||||
|
), |
||||
path('prednasky/hotovo', views.Prednaska_hotovo), |
path('prednasky/hotovo', views.Prednaska_hotovo), |
||||
path('prednasky/metaseznam_prednasek', staff_member_required(views.MetaSeznamListView.as_view()), name='metaseznam-list'), |
path( |
||||
path('prednasky/seznam_prednasek/<int:seznam>/export', staff_member_required(views.SeznamExportView), name='seznam-export'), |
'prednasky/metaseznam_prednasek', |
||||
path('prednasky/seznam_prednasek/<int:seznam>/', staff_member_required(views.SeznamListView.as_view()), name='seznam-list'), |
org_required(views.MetaSeznamListView.as_view()), |
||||
# path('korektury/help/', staff_member_required(views.KorekturyHelpView.as_view()), name='korektury-help'), |
name='metaseznam-list'), |
||||
|
path( |
||||
|
'prednasky/seznam_prednasek/<int:seznam>/export', |
||||
|
org_required(views.SeznamExportView), |
||||
|
name='seznam-export' |
||||
|
), |
||||
|
path( |
||||
|
'prednasky/seznam_prednasek/<int:seznam>/', |
||||
|
org_required(views.SeznamListView.as_view()), |
||||
|
name='seznam-list' |
||||
|
), |
||||
] |
] |
||||
|
@ -0,0 +1,17 @@ |
|||||
|
# Generated by Django 2.2.15 on 2020-08-19 07:59 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0085_nepovinna_prezdivka'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AlterModelOptions( |
||||
|
name='organizator', |
||||
|
options={'ordering': ['-organizuje_do', 'osoba__jmeno', 'osoba__prijmeni'], 'verbose_name': 'Organizátor', 'verbose_name_plural': 'Organizátoři'}, |
||||
|
), |
||||
|
] |
@ -0,0 +1,49 @@ |
|||||
|
# Generated by Django 2.2.16 on 2020-09-04 12:06 |
||||
|
|
||||
|
from django.db import migrations |
||||
|
from logging import getLogger |
||||
|
|
||||
|
log = getLogger(__name__) |
||||
|
|
||||
|
# Oprava migrací 0065 a 0066, kde jsem špatně pochopil django-polymorphic |
||||
|
|
||||
|
# Pomocná funkce -- děláme to samé pro obě polymorfní hierarchie |
||||
|
def fix_ctypes(parent: str, children, apps, schema_editor): |
||||
|
Parent = apps.get_model('seminar', parent) |
||||
|
ContentType = apps.get_model('contenttypes', 'ContentType') |
||||
|
|
||||
|
# Nejdřív všechno smažeme: |
||||
|
Parent.objects.update(polymorphic_ctype=None) |
||||
|
|
||||
|
# Opravíme děti |
||||
|
for clsname in children: |
||||
|
Model = apps.get_model('seminar', clsname) |
||||
|
ct = ContentType.objects.get_for_model(Model) |
||||
|
Model.objects.update(polymorphic_ctype=ct) |
||||
|
|
||||
|
|
||||
|
# Ostatní instance mají mít explicitně content type pro rodiče |
||||
|
new_ct = ContentType.objects.get_for_model(Parent) |
||||
|
for obj in Parent.objects.filter(polymorphic_ctype__isnull=True): |
||||
|
log.warn(f"{parent} \"{obj}\" neměl content type -- nejspíš to je instance přímo {parent}!") |
||||
|
obj.polymorphic_ctype=new_ct |
||||
|
obj.save() |
||||
|
|
||||
|
def fix_treenode(apps, schema_editor): |
||||
|
children = ['RocnikNode', 'CisloNode', 'MezicisloNode', 'TemaVCisleNode', |
||||
|
'OrgTextNode', 'UlohaZadaniNode', 'UlohaVzorakNode', 'PohadkaNode', |
||||
|
'TextNode', 'CastNode', 'ReseniNode'] |
||||
|
fix_ctypes("TreeNode", children, apps, schema_editor) |
||||
|
|
||||
|
def fix_problem(apps, schema_editor): |
||||
|
children = ['Tema', 'Clanek', 'Uloha'] # FIXME: Konfera z nějakého důvodu tenhle field vůbec nemá, asi je to špatně. |
||||
|
fix_ctypes("Problem", children, apps, schema_editor) |
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
dependencies = [ |
||||
|
('seminar', '0086_auto_20200819_0959'), |
||||
|
] |
||||
|
operations = [ |
||||
|
migrations.RunPython(fix_treenode, migrations.RunPython.noop), |
||||
|
migrations.RunPython(fix_problem, migrations.RunPython.noop), |
||||
|
] |
@ -0,0 +1,35 @@ |
|||||
|
# Generated by Django 2.2.15 on 2020-09-05 10:10 |
||||
|
from django.db import migrations |
||||
|
|
||||
|
|
||||
|
def add_perms(apps, schema_editor): |
||||
|
ContentType = apps.get_model('contenttypes', 'ContentType') |
||||
|
User = apps.get_model('auth', 'User') |
||||
|
Permission = apps.get_model('auth', 'Permission') |
||||
|
Resitel = apps.get_model('seminar', 'Resitel') |
||||
|
|
||||
|
c = ContentType.objects.get_for_model(User) |
||||
|
org_perm = Permission.objects.filter(codename__exact='org').first() |
||||
|
if not org_perm: |
||||
|
org_perm = Permission.objects.create(codename='org', name='org', content_type=c) |
||||
|
resitel_perm = Permission.objects.filter(codename__exact='resitel').first() |
||||
|
if not resitel_perm: |
||||
|
resitel_perm = Permission.objects.create(codename='resitel', name='resitel', content_type=c) |
||||
|
for r in Resitel.objects.all(): |
||||
|
u = r.osoba.user |
||||
|
if u: |
||||
|
u.user_permissions.add(resitel_perm) |
||||
|
for org in User.objects.all(): |
||||
|
if org and org.is_staff: |
||||
|
org.user_permissions.add(org_perm) |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0087_fix_polymorphism'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunPython(add_perms, migrations.RunPython.noop), |
||||
|
] |
@ -0,0 +1,14 @@ |
|||||
|
from django.db import migrations |
||||
|
|
||||
|
sql = "update seminar_problemy set typ = 'uloha' where typ like 'b_uloha_';" |
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('seminar', '0058_problem_to_uloha_tema_clanek'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.RunSQL(sql, sql), |
||||
|
] |
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
{% extends "base.html" %} |
||||
|
|
||||
|
{% block nadpis1a %}Formulář byl odeslán{% endblock %} |
||||
|
|
||||
|
{% block content %} |
||||
|
<h1> Formulář byl úspěšně odeslán </h1> |
||||
|
{% for odkaz in odkazy %} |
||||
|
<p><a href="{{odkaz.1}}">{{odkaz.0}}</a></p> |
||||
|
{% endfor %} |
||||
|
{% endblock %} |
@ -0,0 +1,87 @@ |
|||||
|
{% extends "base.html" %} |
||||
|
{# FIXME: Použít ideálně reverse() ke zjišťování URL #} |
||||
|
|
||||
|
{% block content %} |
||||
|
<h2><strong>Informace, komunikace</strong></h2> |
||||
|
|
||||
|
<ul> |
||||
|
<li><strong><a href="https://wiki.mam.bezva.org/">wiki</a> </strong>obsahuje různé návody a know-how</li> |
||||
|
<li><strong><a href="https://riot.im/app/#/room/#orgovna:dolujeme.eu">Riot</a> </strong>chatování s dalšími orgy</li> |
||||
|
<li><strong>Kanboard </strong>správa TODO |
||||
|
<ul> |
||||
|
<li><a href="https://kanboard.ledoian.cz/?controller=BoardViewController&action=show&project_id=10">webařský</a></li> |
||||
|
<li>soustředění</li> |
||||
|
</ul> |
||||
|
</li> |
||||
|
<li><a href="/admin/seminar/novinky/add/"><strong>přidat novinku</strong></a> na web</li> |
||||
|
</ul> |
||||
|
|
||||
|
<hr /> |
||||
|
<h2><strong>Tvorba čísla</strong></h2> |
||||
|
|
||||
|
<ul> |
||||
|
<li><a href="/admin/seminar/problemnavrh/add/"><strong>přidat téma</strong></a></li> |
||||
|
<li><strong>korektury</strong> |
||||
|
<ul> |
||||
|
<li><a href="/korektury/">korekturování</a></li> |
||||
|
<li><a href="/admin/korektury/korekturovanepdf/add/">přidat pdf k opravám</a></li> |
||||
|
</ul> |
||||
|
</li> |
||||
|
<li><a href='{{ posledni_cislo_url }}'><strong>poslední vydané číslo </strong></a></li> |
||||
|
</ul> |
||||
|
<hr /> |
||||
|
|
||||
|
<h2><strong>Moje problémy</strong></h2> |
||||
|
|
||||
|
<h3> Témata </h3> |
||||
|
<ul> |
||||
|
{% for t in temata %} |
||||
|
<li> {{ t }} </li> |
||||
|
{% endfor %} |
||||
|
</ul> |
||||
|
|
||||
|
<h3> Úlohy </h3> |
||||
|
<ul> |
||||
|
{% for u in ulohy %} |
||||
|
<li> {{ u }} </li> |
||||
|
{% endfor %} |
||||
|
</ul> |
||||
|
|
||||
|
<h3> Články </h3> |
||||
|
<ul> |
||||
|
{% for c in clanky %} |
||||
|
<li> {{ c }} </li> |
||||
|
{% endfor %} |
||||
|
</ul> |
||||
|
|
||||
|
<hr /> |
||||
|
<h2><strong>Soustředění</strong></h2> |
||||
|
|
||||
|
<ul> |
||||
|
<li><strong>přednášky</strong> |
||||
|
|
||||
|
<ul> |
||||
|
<li><a href="/admin/prednasky/prednaska/">vypisování přednášek</a></li> |
||||
|
<li>hlasování o přednáškách</li> |
||||
|
</ul> |
||||
|
</li> |
||||
|
<li><a href="/soustredeni/probehlo/">proběhlá soustředění</a> |
||||
|
<ul> |
||||
|
<li>vytvoření galerie</li> |
||||
|
<li>stažení seznamu účastníků</li> |
||||
|
<li>obálky</li> |
||||
|
</ul> |
||||
|
</li> |
||||
|
</ul> |
||||
|
|
||||
|
<hr /> |
||||
|
<h2><strong>Můj profil</strong></h2> |
||||
|
|
||||
|
<ul> |
||||
|
<li><a href="http://127.0.0.1:8000/admin/seminar/organizator/{{ organizator.id }}/change/"><strong>upravit </strong></a></li> |
||||
|
</ul> |
||||
|
|
||||
|
<hr /> |
||||
|
<p>Nemůžeš najít, co hledáš? Může to být v <a href="/admin/">administračním rozhraní webu</a>.</p> |
||||
|
{% endblock content %} |
||||
|
|