def loadForms(self): school_id = fetch.cmbID(self.choice_schools) level_id = fetch.cmbID(self.choice_levels) level = fetch.level_level_id(level_id) if self.checkbox_filter_by_level.GetValue(): sql = "SELECT id, name \ FROM forms \ WHERE level = %d \ AND schYr = %d" % (level, gVar.schYr) else: sql = "SELECT id, name \ FROM forms \ WHERE school_id = %d \ AND schYr = %d" % (school_id, gVar.schYr) loadCmb.gen(self.choice_forms, sql)
def displayData(self, ): if self.checkbox_filter_by_school.GetValue(): gVar.school_id = fetch.cmbID(self.choice_schools) else: gVar.school_id = 0 if self.checkbox_filter_by_level.GetValue(): level_id = fetch.cmbID(self.choice_levels) gVar.level = fetch.level_level_id(level_id) else: gVar.level = 0 if self.checkbox_filter_by_form.GetValue(): gVar.form_id = fetch.cmbID(self.choice_forms) else: gVar.form_id = 0 #rint' send msg' self.GetTopLevelParent().Layout() pub.sendMessage('filter_sch.change')