def init_club_lists(self): self.sizer_clubs.DeleteWindows() self.sizer_clubs.Destroy() self.Layout() club_dict = fetch.exculGroupsDATA_forScheduleID(schedule_id) rows = math.ceil(len(club_dict)/3 + .5) self.sizer_clubs = wx.GridSizer(rows, 3, 5, 5) self.panel_clubListCtrls.SetSizer(self.sizer_clubs) self.club_listCtrls = [] self.vClubListCtrls = {} for key in club_dict: club_id = int(key) club_info = club_dict[club_id] self.vClubListCtrls[key] = vl = VirtualList(self.panel_clubListCtrls, -1, style=wx.LC_REPORT) self.club_listCtrls.append(vl) self.sizer_clubs.Add(vl, 1, wx.EXPAND | wx.ALL, 5) club_name = club_info[2] columns=(('ID',40), (club_name,150),('Class',50)) vl.SetColumns(columns) vl.SetName(str(key)) l = fetch.excul_studentList(club_id) vl.SetItemMap(l)
def exculTeacherPool(cmb, schedule_id, edited_teacher_id=0): exculList = fetch.exculGroupsDATA_forScheduleID(schedule_id) for x in exculList: print exculList[x] teacherIDs = [str(exculList[x][3]) for x in exculList] print 'teacherIDs',teacherIDs if edited_teacher_id: l = [] for x in teacherIDs: if not x == str(edited_teacher_id): l.append(x) teacherIDs = l listStr = "'%s'" % ','.join(teacherIDs) sql = " SELECT id, name \ FROM staff \ WHERE position_id = 33 \ AND %d BETWEEN join_schYr AND exit_schYr \ AND NOT FIND_IN_SET(id, %s) \ ORDER BY name" % (gVar.schYr, listStr) print sql fillCmb(cmb, fetch.getAllCol(sql),'without teacher') restore(cmb, int(edited_teacher_id))
def getScheduleData(self, schedule_id): data = fetch.exculGroupsDATA_forScheduleID(schedule_id) print schedule_id, ' > exculGroupsDATA_forScheduleID > ', data return data