def __init__(self, parent, rowIdx): super(CPDViewCtrl, self).__init__(parent, size=(500, 300), style=wx.LB_BOTTOM) from access.cpd import CPDTable cpdTable = CPDTable() rows = cpdTable.showAll() row = rows[rowIdx] print row from cpdtableitem import CPDTableDef from access.database import DBTable cpdTableBind = DBTable(CPDTableDef()) self.dbRow = cpdTableBind.GetRow(row) self.generalCtrl = GeneralCtrl(self) self.AddPage(self.generalCtrl, "General") self.otherCtrl = OtherCtrl(self) self.AddPage(self.otherCtrl, "Details") self.historyCtrl = HistoryCtrl(self) self.AddPage(self.historyCtrl, "Documentation")
def test92(self): ''' Select first name and surname ''' pa = CPDTable() rows = pa.selectcols(cpd_id=True, date_started=True, days_taken=True) for row in rows: print row
def test94(self): pa = CPDTable() for i in range(5,13): pa.update(i, appointment_id=str(i+200)) where = pa.singlewhere(appointment_id='200') rows = pa.selectall(whereStr=where) for row in rows: print row
def __init__(self, parent, style=wx.TAB_TRAVERSAL): super(CPDCtrl, self).__init__(parent, style=style) self.selected_row = 0; self.cpdTable = CPDTable() self.rows = self.cpdTable.showAll() self.cpdListCtrl = CPDListCtrl(self) self.cpdListCtrl.populateList(self.rows) from cpdtableitem import CPDTableDef from access.database import DBTable
def __init__(self, parent, rowIdx): super(CPDViewPanel, self).__init__(parent, style=wx.LB_BOTTOM) from access.cpd import CPDTable cpdTable = CPDTable() rows = cpdTable.showAll() row = rows[rowIdx] print row from cpdtableitem import CPDTableDef from access.database import DBTable cpdTableBind = DBTable(CPDTableDef()) '''
def NewCPD(self): cpdTable = CPDTable() cpdTable.add( title=self.cpdGeneralPage.title.GetValue(), date_started=self.cpdGeneralPage.date_started.GetValue(), days_taken=self.cpdGeneralPage.days_taken.GetValue(), activity_type=self.cpdGeneralPage.activity_type.GetValue(), category=self.cpdGeneralPage.category.GetValue(), core_cpd_module=self.cpdGeneralPage.core_cpd_module.GetValue(), description=self.cpdGeneralPage.description.GetValue(), learning_objectives=self.cpdGeneralPage.learning_objectives. GetValue(), reflective_comments=self.cpdOtherPage.reflective_comments.GetValue( ), attached_files=None, web_links=None, )
def test80(self): ''' Initalise Table with date ''' ''' cpd_id integer primary key, date_started datetime not null, days_taken int , activity_type varchar(100), category varchar(100), core_cpd_module varchar(256), discripttion varchar(512), learning_objectives varchar(512), reflective_comments varchar(512), attached_files varchar(512), web_links varchar(512) ''' a = CPDTable() a.add(10,'25-01-2013',3,"Coure") a.add(11,'05-02-2013',12,"On Job training") a.add(12,'25-02-2013',4,"Coure") a.add(13,'04-04-2013',8,"Coure") a.add(14,'20-04-2013',5,"Coure") a.add(15,'01-06-2013',8,"Coure") a.add(16,'11-06-2013',12,"Coure") a.add(17,'14-11-2013',38,"Coure")
def test93(self): pa = CPDTable() idx = pa.get_id(34) assert idx != None, "Item not found" row = pa.showItem(idx) print row
def test91(self): ''' Selete all data ''' pa = CPDTable() rows = pa.selectall() n = len(rows) assert n == 8, "Need to have 8 rows "