|
@ -310,24 +310,24 @@ def check_problem_common(): |
|
|
|
|
|
|
|
|
def check_uloha(): |
|
|
def check_uloha(): |
|
|
old_query = "SELECT * FROM seminar_problemy WHERE typ = 'uloha' ORDER BY id" |
|
|
old_query = "SELECT * FROM seminar_problemy WHERE typ = 'uloha' ORDER BY id" |
|
|
new_query = """SELECT cislo_zadani, cislo_reseni, problem_ptr_id, max_body, uzt.na_web AS text_zadani, uvt.na_web AS text_reseni |
|
|
new_query = """SELECT cislo_zadani_id, cislo_reseni_id, problem_ptr_id, max_body, uzt.na_web AS text_zadani, uvt.na_web AS text_reseni |
|
|
FROM seminar_ulohy |
|
|
FROM seminar_ulohy |
|
|
-- Problém: |
|
|
-- Problém: |
|
|
JOIN seminar_problemy AS problem ON problem_ptr_id = problem.id |
|
|
JOIN seminar_problemy AS problem ON problem_ptr_id = problem.id |
|
|
-- Text zadání: |
|
|
-- Text zadání: |
|
|
INNER JOIN seminar_nodes_uloha_zadani AS uzn ON id = uzn.uloha_id |
|
|
INNER JOIN seminar_nodes_uloha_zadani AS uzn ON problem.id = uzn.uloha_id |
|
|
INNER JOIN seminar_nodes_treenode AS uztn ON uztn.id = uzn.treenode_ptr_id |
|
|
INNER JOIN seminar_nodes_treenode AS uztn ON uztn.id = uzn.treenode_ptr_id |
|
|
INNER JOIN seminar_nodes_obsah AS uzo ON uzo.treenode_ptr_id = uztn.first_child_id |
|
|
INNER JOIN seminar_nodes_obsah AS uzo ON uzo.treenode_ptr_id = uztn.first_child_id |
|
|
INNER JOIN seminar_texty AS uzt ON uzo.text_id = uzt.id |
|
|
INNER JOIN seminar_texty AS uzt ON uzo.text_id = uzt.id |
|
|
-- Text vzoráku: |
|
|
-- Text vzoráku: |
|
|
INNER JOIN seminar_nodes_uloha_zadani AS uvn ON id = uvn.uloha_id |
|
|
INNER JOIN seminar_nodes_uloha_zadani AS uvn ON problem.id = uvn.uloha_id |
|
|
INNER JOIN seminar_nodes_treenode AS uvtn ON uvtn.id = uvn.treenode_ptr_id |
|
|
INNER JOIN seminar_nodes_treenode AS uvtn ON uvtn.id = uvn.treenode_ptr_id |
|
|
INNER JOIN seminar_nodes_obsah AS uvo ON uvo.treenode_ptr_id = uvtn.first_child_id |
|
|
INNER JOIN seminar_nodes_obsah AS uvo ON uvo.treenode_ptr_id = uvtn.first_child_id |
|
|
INNER JOIN seminar_texty AS uvt ON uvo.text_id = uvt.id |
|
|
INNER JOIN seminar_texty AS uvt ON uvo.text_id = uvt.id |
|
|
|
|
|
|
|
|
ORDER BY problem_ptr_id""" |
|
|
ORDER BY problem_ptr_id""" |
|
|
|
|
|
|
|
|
same_fields = ['cislo_zadani', 'cislo_reseni', 'text_zadani', 'text_reseni'] |
|
|
same_fields = ['cislo_zadani_id', 'cislo_reseni_id', 'text_zadani', 'text_reseni'] |
|
|
renamed_fields = [ |
|
|
renamed_fields = [ |
|
|
('id', 'problem_ptr_id'), |
|
|
('id', 'problem_ptr_id'), |
|
|
('body', 'max_body'), |
|
|
('body', 'max_body'), |
|
@ -349,7 +349,7 @@ def check_tema(): |
|
|
FROM seminar_problemy |
|
|
FROM seminar_problemy |
|
|
INNER JOIN seminar_cisla AS c ON c.id = cislo_zadani_id |
|
|
INNER JOIN seminar_cisla AS c ON c.id = cislo_zadani_id |
|
|
WHERE typ IN ('tema', 'serial') |
|
|
WHERE typ IN ('tema', 'serial') |
|
|
ORDER BY id""" |
|
|
ORDER BY seminar_problemy.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 |
|
|
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 |
|
|
FROM seminar_temata |
|
|
-- Problém: |
|
|
-- Problém: |
|
@ -408,10 +408,10 @@ def check_res_clanek(): |
|
|
JOIN seminar_problemy AS problem ON problem_ptr_id = problem.id |
|
|
JOIN seminar_problemy AS problem ON problem_ptr_id = problem.id |
|
|
INNER JOIN seminar_hodnoceni AS hodn ON problem.id = hodn.problem_id |
|
|
INNER JOIN seminar_hodnoceni AS hodn ON problem.id = hodn.problem_id |
|
|
INNER JOIN seminar_reseni AS rese ON rese.id = hodn.reseni_id |
|
|
INNER JOIN seminar_reseni AS rese ON rese.id = hodn.reseni_id |
|
|
INNER JOIN seminar_nodes_reseni AS resnode ON resnode.reseni_id = rese.id |
|
|
INNER JOIN seminar_nodes_otistene_reseni AS resnode ON resnode.reseni_id = rese.id |
|
|
INNER JOIN seminar_nodes_treenode AS tn ON resnode.treenode_ptr_id = tn.id |
|
|
INNER JOIN seminar_nodes_treenode AS tn ON resnode.treenode_ptr_id = tn.id |
|
|
INNER JOIN seminar_nodes_obsah AS on ON on.treenode_ptr_id = tn.first_child_id |
|
|
INNER JOIN seminar_nodes_obsah AS son ON son.treenode_ptr_id = tn.first_child_id |
|
|
INNER JOIN seminar_texty AS text ON text.id = on.text_id |
|
|
INNER JOIN seminar_texty AS text ON text.id = son.text_id |
|
|
|
|
|
|
|
|
ORDER BY problem_ptr_id""" |
|
|
ORDER BY problem_ptr_id""" |
|
|
same_fields = ['text_zadani'] |
|
|
same_fields = ['text_zadani'] |
|
@ -451,10 +451,10 @@ check_nastaveni() |
|
|
check_novinky() |
|
|
check_novinky() |
|
|
check_pohadka() |
|
|
check_pohadka() |
|
|
|
|
|
|
|
|
check_problem_common() |
|
|
#check_problem_common() - RUZNE POCTY RADKU |
|
|
check_uloha() |
|
|
#check_uloha() - RUNE POCTY RADKU |
|
|
check_tema() |
|
|
#check_tema() - RUZNE POCTY RADKU |
|
|
check_konfera() |
|
|
check_konfera() |
|
|
check_org_clanek() |
|
|
check_org_clanek() |
|
|
check_res_clanek() |
|
|
#check_res_clanek() - RUZNE POCTY RADKU |
|
|
check_untyped_problem() |
|
|
check_untyped_problem() |
|
|