Téma -> ročník
This commit is contained in:
parent
86bc839f2a
commit
6c71f050d0
1 changed files with 12 additions and 6 deletions
|
@ -325,24 +325,31 @@ def check_uloha():
|
|||
raise ValueError("Úloha má deadline.")
|
||||
|
||||
def check_tema():
|
||||
old_query = "SELECT * FROM seminar_problemy WHERE typ IN ('tema', 'serial') ORDER BY id"
|
||||
new_query = """SELECT tema_typ, zad_text.na_web AS text_zadani, res_text.na_web AS text_reseni
|
||||
old_query = """SELECT text_zadani, text_reseni, typ, c.rocnik_id AS rocnik_id
|
||||
FROM seminar_problemy
|
||||
INNER JOIN seminar_cisla as c ON c.id = cislo_zadani_id
|
||||
WHERE typ IN ('tema', 'serial')
|
||||
ORDER BY id"""
|
||||
new_query = """SELECT tema_typ, zad_text.na_web AS text_zadani, res_text.na_web AS text_reseni, rn.rocnik_id AS rocnik_id
|
||||
FROM seminar_temata
|
||||
-- Problém:
|
||||
JOIN seminar_problemy AS problem ON problem_ptr_id = problem.id
|
||||
-- Text:
|
||||
-- TvCNode má dva potomky, oba TextNode. První drží původní text zadání, druhý řešení.
|
||||
INNER JOIN seminar_nodes_temavcisle AS tvcn ON tvcn.tema_id = id
|
||||
INNER JOIN seminar_nodes_treenode AS roottn ON tvcn.treenode_ptr_id = roottn.id
|
||||
INNER JOIN seminar_nodes_treenode AS zad_tn ON roottn.first_child_id = zad_tn.id
|
||||
INNER JOIN seminar_nodes_treenode AS ttn ON tvcn.treenode_ptr_id = ttn.id
|
||||
INNER JOIN seminar_nodes_treenode AS zad_tn ON ttn.first_child_id = zad_tn.id
|
||||
INNER JOIN seminar_nodes_treenode AS res_tn ON zad_tn.succ_id = res_tn.id
|
||||
INNER JOIN seminar_nodes_obsah AS zad_on ON zad_on.treenode_ptr_id = zad_tn.id
|
||||
INNER JOIN seminar_nodes_obsah AS res_on ON res_on.treenode_ptr_id = res_tn.id
|
||||
INNER JOIN seminar_texty AS zad_text ON zad_on.text_id = zad_text.id
|
||||
INNER JOIN seminar_texty AS res_text ON res_on.text_id = res_text.id
|
||||
-- Ročník tématu:
|
||||
-- Podle rootu TvCN
|
||||
INNER JOIN seminar_nodes_rocnik AS rn ON ttn.root_id = rn.treenode_ptr_id
|
||||
|
||||
ORDER BY problem_ptr_id"""
|
||||
same_fields = ['text_zadani', 'text_reseni']
|
||||
same_fields = ['text_zadani', 'text_reseni', 'rocnik_id']
|
||||
renamed_fields = [
|
||||
('typ', 'tema_typ'),
|
||||
]
|
||||
|
@ -354,7 +361,6 @@ def check_tema():
|
|||
|
||||
for o,n in res:
|
||||
check_same(o,n, old_fields, new_fields)
|
||||
#TODO: Tema.rocnik
|
||||
|
||||
def check_konfera():
|
||||
old_query = "SELECT * FROM seminar_problemy WHERE typ = 'konfera'"
|
||||
|
|
Loading…
Reference in a new issue