@ -309,7 +309,13 @@ def check_pohadka():
# Problémy jsou rozdělené podle typů:
# Problémy jsou rozdělené podle typů:
def check_problem_common ( ) :
def check_problem_common ( ) :
query = " SELECT * FROM seminar_problemy ORDER BY id "
old_query = " SELECT id, nazev, stav, kod, autor_id, text_org, timestamp, typ FROM seminar_problemy ORDER BY id "
new_query = """ SELECT sp.id AS id, sp.nazev AS nazev, sp.stav AS stav, sp.kod AS kod, au.id AS autor_id, sp.poznamka AS poznamka, sp.vytvoreno AS vytvoreno
FROM seminar_problemy AS sp
LEFT OUTER JOIN seminar_organizator AS so ON sp . autor_id = so . id
LEFT OUTER JOIN seminar_osoby AS sos ON so . osoba_id = sos . id
LEFT OUTER JOIN auth_user AS au ON sos . user_id = au . id
ORDER BY sp . id """
same_fields = [ ' id ' , ' nazev ' , ' stav ' , ' autor_id ' , ' kod ' ]
same_fields = [ ' id ' , ' nazev ' , ' stav ' , ' autor_id ' , ' kod ' ]
renamed_fields = [
renamed_fields = [
@ -319,7 +325,7 @@ def check_problem_common():
old_fields = same_fields + [ f [ 0 ] for f in renamed_fields ]
old_fields = same_fields + [ f [ 0 ] for f in renamed_fields ]
new_fields = same_fields + [ f [ 1 ] for f in renamed_fields ]
new_fields = same_fields + [ f [ 1 ] for f in renamed_fields ]
old_res , new_res = execute_simple ( query )
old_res , new_res = execute_simple ( old_query , new_ query)
res = zip ( old_res , new_res )
res = zip ( old_res , new_res )
for o , n in res :
for o , n in res :