6 from datetime
import datetime
61 self.
completed = db.select(
'checks2', [
'datetime(completed,\'localtime\')'],
'id=?', [self.
db_id])
70 self.
modified = db.select(
'checks2', [
'datetime(modified,\'localtime\')'],
'id=?', [self.
db_id])
76 if self.
db_id !=
None:
77 db.update(
'checks2', [
'test2_index'],
'id=?', [self.
test2_index, self.
db_id])
79 raise Exception(
'Cannot update test2_index on Check2 instance that is not in the databse.')
86 if self.
db_id !=
None:
87 db.update_timestamp_col(
'checks2', col,
'id=?', [self.
db_id])
89 raise Exception(
'Cannot update timestamp because Check2 instance is not in the database.')
96 cols =
'csv_file wav_folder activities environments blocks_per_activity completed test2_index'.split()
102 last_ids = db.insert(
'checks2', cols, [row])
103 self.
db_id = last_ids[0]
106 checks2_rows = db.select(
'checks2', [
"datetime(created,'localtime')",
"datetime(modified,'localtime')"],
'id=?', [str(self.
db_id)])
107 self.
created = datetime.strptime(checks2_rows[0][0], DBConstants.DB_DATETIME_FMT)
108 self.
modified = datetime.strptime(checks2_rows[0][1], DBConstants.DB_DATETIME_FMT)
121 num_rows = db.delete(
'checks2',
'id=?', [self.
db_id])
130 DBObject.db_select(db, ids)
133 where_cond = DBObject._build_where_cond_from_ids(ids)
136 rows = db.select(
'checks2',
'csv_file wav_folder activities environments blocks_per_activity datetime(completed,\'localtime\') datetime(created,\'localtime\') datetime(modified,\'localtime\') test2_index id'.split(), where_cond)
142 test2s = Test2.db_select_by_check2(db, cur_row[9])
148 pickle.loads(cur_row[2]),
149 pickle.loads(cur_row[3]),
159 check2_list.append(check2)