old_query='SELECT * FROM seminar_reseni ORDER BY id'
old_query='SELECT * FROM seminar_reseni ORDER BY id'
new_query='SELECT * FROM seminar_reseni JOIN seminar_hodnoceni AS hodnoceni ON hodnoceni_id = hodnoceni.id ORDER BY id'
new_query='SELECT id, forma, poznamka, cas_doruceni, hodnoceni.problem_id AS h_problem_id, hodnoceni.body AS h_body, hodnoceni.cislo_body_id AS h_cislo_body_id FROM seminar_reseni JOIN seminar_hodnoceni AS hodnoceni ON hodnoceni_id = hodnoceni.id ORDER BY id'
same_fields=['id','forma','poznamka']
same_fields=['id','forma','poznamka']
renamed_fields=[('timestamp','cas_doruceni'),
renamed_fields=[('timestamp','cas_doruceni'),
('problem_id','hodnoceni.problem_id'),
('problem_id','h_problem_id'),
('body','hodnoceni.body'),
('body','h_body'),
('cislo_body_id','hodnoceni.cislo_body_id'),
('cislo_body_id','h_cislo_body_id'),
]
]
old_fields=same_fields+[f[0]forfinrenamed_fields]
old_fields=same_fields+[f[0]forfinrenamed_fields]
new_fields=same_fields+[f[1]forfinrenamed_fields]
new_fields=same_fields+[f[1]forfinrenamed_fields]
@ -133,14 +135,14 @@ def check_reseni():
defcheck_organizator():
defcheck_organizator():
old_query='SELECT * FROM seminar_organizatori ORDER BY id'
old_query='SELECT * FROM seminar_organizatori ORDER BY id'
new_query='SELECT * FROM seminar_organizatori JOIN seminar_osoby AS osoba ON osoba_id = osoba.id JOIN auth_user AS user ON osoba.user_id = user.id ORDER BY id'
new_query='SELECT studuje, strucny_popis_organizatora, user.id AS uid, osoba.prezdivka AS o_prezdivka, osoba.foto AS o_foto, osoba.foto_male AS o_foto_male FROM seminar_organizatori JOIN seminar_osoby AS osoba ON osoba_id = osoba.id JOIN auth_user AS user ON osoba.user_id = user.id ORDER BY id'