def displayData(self): #rint"panel_bookingsReportGrid : displayData" self.number_of_grids = 0 if self.widgetSizer.GetChildren(): self.widgetSizer.Hide(0) self.widgetSizer.Remove(0) # create a new grid grid = self.grid = gridlib.Grid(self) self.set_grid_properties() self.widgetSizer.Add(grid, 1, wx.EXPAND, 0) columnlabels = [("TYPE", 80), ("ID", 30), ("COURSE NAME", 200), ("NOW", 45), ("OUT", 45), ("CONT.", 55), ("REDO", 45), ("TOTAL",85), ("NEW",45), ("TOTAL",55), ("FORM SIZE",95), ("FORMS",75)] self.setColumnLabels(columnlabels) self.Layout() #grid.DeleteRows(1,r) #grid.AppendRows(150) sql ="SELECT course_id \ FROM courses_by_year \ WHERE schYr = %d" % gVar.schYr ##rintsql course_ids = fetch.getList(sql) sql ="SELECT level \ FROM course_levels \ ORDER BY level" course_levels = fetch.getList(sql) #rint'course_ids, course_levels ', course_ids, ',', course_levels row = 0 for level in course_levels: self.formatRow(row) if level == course_levels[0]: #rint'>' row = self.displayDataForLowerLevelNextYearsCourses(level, row) #row = self.dispalyDataForLastYearsKelases(level, row) row = self.dispalyDataForNextYearsCourses(level, row)
def getKids(self, kode): if kode > 10000: kode -= 10000 sql = "SELECT Nama FROM Siswa WHERE KOrangTua = %d GROUP BY Nama" % kode res = fetch.getList(sql) l = (',').join(res) return l