Merge branch 'data_migrations' of gimli.ms.mff.cuni.cz:/akce/mam/git/mamweb into data_migrations
This commit is contained in:
commit
e1d563f00d
10 changed files with 35 additions and 13 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -25,8 +25,11 @@ TODO
|
||||||
# .htpasswd kvůli přihlášení
|
# .htpasswd kvůli přihlášení
|
||||||
.htpasswd
|
.htpasswd
|
||||||
|
|
||||||
|
# .htpasswd pro AESOPa
|
||||||
|
/.htpasswd-aesop
|
||||||
|
|
||||||
# reversion kvůli historii objektů v reversion
|
# reversion kvůli historii objektů v reversion
|
||||||
**/reversion
|
**/reversion
|
||||||
|
|
||||||
# pro lidi, co programují v nástrojích od JetBrains
|
# pro lidi, co programují v nástrojích od JetBrains
|
||||||
.idea
|
.idea
|
||||||
|
|
|
@ -67,3 +67,5 @@ LOGGING['loggers']['']['handlers'] = ['console', 'mail_admins']
|
||||||
LOGGING['loggers']['django']['handlers'] = ['console', 'mail_admins']
|
LOGGING['loggers']['django']['handlers'] = ['console', 'mail_admins']
|
||||||
LOGGING['handlers']['registration_logfile']['filename'] = '/home/mam-web/logs/test/registration.log'
|
LOGGING['handlers']['registration_logfile']['filename'] = '/home/mam-web/logs/test/registration.log'
|
||||||
LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/test/registration_errors.log'
|
LOGGING['handlers']['registration_error_log']['filename'] = '/home/mam-web/logs/test/registration_errors.log'
|
||||||
|
|
||||||
|
FILE_UPLOAD_PERMISSIONS = 0o440
|
||||||
|
|
BIN
mamweb/static/images/graf/fyzika.JPG
Normal file
BIN
mamweb/static/images/graf/fyzika.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 201 KiB |
BIN
mamweb/static/images/graf/informatika.jpg
Normal file
BIN
mamweb/static/images/graf/informatika.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 KiB |
BIN
mamweb/static/images/graf/matematika.jpg
Normal file
BIN
mamweb/static/images/graf/matematika.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 KiB |
|
@ -408,8 +408,7 @@
|
||||||
y="597.18036">Články</tspan></text>
|
y="597.18036">Články</tspan></text>
|
||||||
</g>
|
</g>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a href="/static/images/graf/matematika.jpg"
|
||||||
href="/aktualni/zadani/"
|
|
||||||
id="temata"
|
id="temata"
|
||||||
transform="matrix(0.70138313,0,0,0.7462289,-192.38886,20.298351)">
|
transform="matrix(0.70138313,0,0,0.7462289,-192.38886,20.298351)">
|
||||||
<g
|
<g
|
||||||
|
@ -439,7 +438,7 @@
|
||||||
</g>
|
</g>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="/aktualni/zadani/"
|
href="/static/images/graf/fyzika.jpg"
|
||||||
id="a74"
|
id="a74"
|
||||||
transform="matrix(0.70138313,0,0,0.7462289,-192.38886,20.298351)">
|
transform="matrix(0.70138313,0,0,0.7462289,-192.38886,20.298351)">
|
||||||
<g
|
<g
|
||||||
|
@ -469,7 +468,7 @@
|
||||||
</g>
|
</g>
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href="/aktualni/zadani/"
|
href="/static/images/graf/informatika.jpg"
|
||||||
id="a80"
|
id="a80"
|
||||||
transform="matrix(0.70138313,0,0,0.7462289,-192.38886,20.298351)">
|
transform="matrix(0.70138313,0,0,0.7462289,-192.38886,20.298351)">
|
||||||
<g
|
<g
|
||||||
|
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
@ -9,6 +9,7 @@ from .models import Problem, Cislo, Reseni, Nastaveni, Rocnik, Soustredeni
|
||||||
#from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva
|
#from .models import VysledkyZaCislo, VysledkyKCisluZaRocnik, VysledkyKCisluOdjakziva
|
||||||
from .ovvpfile import OvvpFile
|
from .ovvpfile import OvvpFile
|
||||||
from seminar import views
|
from seminar import views
|
||||||
|
from seminar.views import vysledkovka
|
||||||
from seminar.utils import aktivniResitele
|
from seminar.utils import aktivniResitele
|
||||||
|
|
||||||
class ExportIndexView(generic.View):
|
class ExportIndexView(generic.View):
|
||||||
|
@ -78,20 +79,24 @@ class ExportRocnikView(generic.View):
|
||||||
rocnik = get_object_or_404(Rocnik, prvni_rok=pr, exportovat=True)
|
rocnik = get_object_or_404(Rocnik, prvni_rok=pr, exportovat=True)
|
||||||
cislo = rocnik.posledni_zverejnena_vysledkovka_cislo()
|
cislo = rocnik.posledni_zverejnena_vysledkovka_cislo()
|
||||||
resitele = aktivniResitele(cislo, True)
|
resitele = aktivniResitele(cislo, True)
|
||||||
slovnik_body = views.secti_body_za_rocnik(cislo, resitele)
|
slovnik_body = vysledkovka.secti_body_za_rocnik(cislo, resitele, False)
|
||||||
_, setrizeni_resitele, setrizene_body = views.setrid_resitele_a_body(slovnik_body)
|
setrizeni_resitele, body = vysledkovka.setrid_resitele_a_body(slovnik_body)
|
||||||
|
|
||||||
of = default_ovvpfile('MaM.rocnik', rocnik)
|
of = default_ovvpfile('MaM.rocnik', rocnik)
|
||||||
of.headers['comment'] = u'MaM-Web export aktivnich resitelu rocniku {rocnik} do cisla {cislo}'.format(rocnik=rocnik, cislo=cislo)
|
of.headers['comment'] = u'MaM-Web export aktivnich resitelu rocniku {rocnik} do cisla {cislo}'.format(rocnik=rocnik, cislo=cislo)
|
||||||
of.columns = ['id', 'name', 'surname', 'gender', 'born', 'email', 'end-year',
|
of.columns = ['id', 'name', 'surname', 'gender', 'born', 'email', 'end-year',
|
||||||
'street', 'town', 'postcode', 'country', 'spam-flag', 'spam-date',
|
'street', 'town', 'postcode', 'country', 'spam-flag', 'spam-date',
|
||||||
'school', 'school-name', 'points', 'rank',]
|
'school', 'school-name', 'points', 'rank',]
|
||||||
|
|
||||||
|
resitele_slovnik = {}
|
||||||
|
for r in resitele:
|
||||||
|
resitele_slovnik[r.id] = r
|
||||||
|
|
||||||
# počítání pořadí řešitelů
|
# počítání pořadí řešitelů
|
||||||
posledni_body = 100000
|
posledni_body = 100000
|
||||||
posledni_poradi = 0
|
posledni_poradi = 0
|
||||||
for i in range(len(setrizeni_resitele)):
|
for i in range(len(setrizeni_resitele)):
|
||||||
rd = setrizeni_resitele[i].export_row()
|
rd = resitele_slovnik[setrizeni_resitele[i]].export_row()
|
||||||
|
|
||||||
if posledni_body > body[i]:
|
if posledni_body > body[i]:
|
||||||
posledni_body = body[i]
|
posledni_body = body[i]
|
||||||
|
|
|
@ -680,6 +680,17 @@ class Cislo(SeminarModelBase):
|
||||||
# Neexistující *Node nemá smysl aktualizovat.
|
# Neexistující *Node nemá smysl aktualizovat.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def clean(self):
|
||||||
|
# Finální deadline má být až poslední a je povinný, pokud nějaký deadline existuje.
|
||||||
|
# Existence:
|
||||||
|
if self.datum_deadline is None and (self.datum_preddeadline is not None or self.datum_deadline_soustredeni is not None):
|
||||||
|
raise ValidationError({'datum_deadline': "Číslo musí mít finální deadline, pokud má nějaké deadliny"})
|
||||||
|
if self.datum_deadline is not None:
|
||||||
|
if self.datum_preddeadline is not None and self.datum_preddeadline > self.datum_deadline:
|
||||||
|
raise ValidationError({'datum_preddeadline': "Předdeadline musí předcházet finálnímu deadlinu"})
|
||||||
|
if self.datum_deadline_soustredeni is not None and self.datum_deadline_soustredeni > self.datum_deadline:
|
||||||
|
raise ValidationError({'datum_deadline_soustredeni': "Soustřeďkový deadline musí předcházet finálnímu deadlinu"})
|
||||||
|
|
||||||
@reversion.register(ignore_duplicates=True)
|
@reversion.register(ignore_duplicates=True)
|
||||||
class Organizator(SeminarModelBase):
|
class Organizator(SeminarModelBase):
|
||||||
# zmena dedicnosti z models.Model na SeminarModelBase, potencialni vznik bugu
|
# zmena dedicnosti z models.Model na SeminarModelBase, potencialni vznik bugu
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
\setlength{\tabcolsep}{3pt}
|
\setlength{\tabcolsep}{3pt}
|
||||||
\begin{longtable}{|r|l|c|r|{% for p in problemy %}c@{\hskip.5em}{% endfor %}|r|r|}\hline
|
\begin{longtable}{|r|l|c|r|{% for p in problemy %}c@{\hskip.5em}{% endfor %}|r|r|}\hline
|
||||||
& & & & \multicolumn{ {{ problemy|length}} }{c|}{\textbf{Úlohy}} & & \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in problemy %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline
|
& & & & \multicolumn{ {{ problemy|length}} }{c|}{\textbf{Témata}} & & \\\textbf{Poř.}& \textbf{Jméno}& \textbf{R.}& \raisebox{0.7mm}{$\sum_{-1}$}& {% for p in problemy %}\textbf{ {{ p.kod_v_rocniku }} }&{% endfor %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline
|
||||||
\endhead
|
\endhead
|
||||||
\hline
|
\hline
|
||||||
\endfoot
|
\endfoot
|
||||||
|
|
|
@ -71,17 +71,17 @@ urlpatterns = [
|
||||||
# Aesop
|
# Aesop
|
||||||
path(
|
path(
|
||||||
'aesop-export/mam-rocnik-<int:prvni_rok>.csv',
|
'aesop-export/mam-rocnik-<int:prvni_rok>.csv',
|
||||||
org_required(export.ExportRocnikView.as_view()),
|
export.ExportRocnikView.as_view(),
|
||||||
name='seminar_export_rocnik'
|
name='seminar_export_rocnik'
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
'aesop-export/mam-sous-<str:datum_zacatku>.csv',
|
'aesop-export/mam-sous-<str:datum_zacatku>.csv',
|
||||||
org_required(export.ExportSousView.as_view()),
|
export.ExportSousView.as_view(),
|
||||||
name='seminar_export_sous'
|
name='seminar_export_sous'
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
'aesop-export/index.csv',
|
'aesop-export/index.csv',
|
||||||
org_required(export.ExportIndexView.as_view()),
|
export.ExportIndexView.as_view(),
|
||||||
name='seminar_export_index'
|
name='seminar_export_index'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -134,7 +134,9 @@ urlpatterns = [
|
||||||
|
|
||||||
path('prihlaska/',views.prihlaskaView, name='seminar_prihlaska'),
|
path('prihlaska/',views.prihlaskaView, name='seminar_prihlaska'),
|
||||||
path('prihlasit/', views.LoginView.as_view(), name='login'),
|
path('prihlasit/', views.LoginView.as_view(), name='login'),
|
||||||
|
path('login/', RedirectView.as_view(pattern_name='login', permanent=True, query_string=True)),
|
||||||
path('odhlasit/', views.LogoutView.as_view(), name='logout'),
|
path('odhlasit/', views.LogoutView.as_view(), name='logout'),
|
||||||
|
path('logout/', RedirectView.as_view(pattern_name='login', permanent=True, query_string=True)),
|
||||||
path('resitel/', resitel_required(views.ResitelView.as_view()), name='seminar_resitel'),
|
path('resitel/', resitel_required(views.ResitelView.as_view()), name='seminar_resitel'),
|
||||||
path('resitel/odevzdana_reseni/', resitel_required(views.PrehledOdevzdanychReseni.as_view()), name='seminar_resitel_odevzdana_reseni'),
|
path('resitel/odevzdana_reseni/', resitel_required(views.PrehledOdevzdanychReseni.as_view()), name='seminar_resitel_odevzdana_reseni'),
|
||||||
path('reset-hesla/', views.PasswordResetView.as_view(), name='reset_password'),
|
path('reset-hesla/', views.PasswordResetView.as_view(), name='reset_password'),
|
||||||
|
|
Loading…
Reference in a new issue