Home | History | Annotate | Download | only in tko

Lines Matching refs:where

225     def _where_clause(self, where):
226 if not where:
229 if isinstance(where, dict):
232 for field, value in where.iteritems():
240 elif isinstance(where, basestring):
242 where_clause = where
244 elif isinstance(where, tuple):
245 # preformatted where clause + values
246 where_clause, values = where
249 raise ValueError('Invalid "where" value: %r' % where)
251 return ' WHERE ' + where_clause, values
255 def select(self, fields, table, where, distinct=False, group_by=None,
259 specific table with a particular where clause.
260 The where clause can either be a dictionary of
269 where = ("a = %s AND b = %s", ['val', 'val'])
271 where = "a = 'val' AND b = 'val'"
275 @param where: The where clause string.
285 where_clause, values = self._where_clause(where)
370 def delete(self, table, where, commit = None):
374 @param where: The where clause.
380 where_clause, values = self._where_clause(where)
388 def update(self, table, data, where, commit = None):
390 'update table set data values (%s ... %s) where ...'
397 @param where: The where clause.
408 where_clause, where_values = self._where_clause(where)
425 where = {'test_idx' : test_idx}
426 self.delete('tko_iteration_result', where)
427 self.delete('tko_iteration_perf_value', where)
428 self.delete('tko_iteration_attributes', where)
429 self.delete('tko_test_attributes', where)
431 where = {'job_idx' : job_idx}
432 self.delete('tko_tests', where)
433 self.delete('tko_jobs', where)
495 where = {'job_id': job.index, 'key': key}
496 data = dict(where, value=value)
497 exists = self.select('id', 'tko_job_keyvals', where=where)
500 self.update('tko_job_keyvals', data, where=where, commit=commit)
524 where = {'test_idx': test_idx}
525 self.delete('tko_iteration_result', where)
526 self.delete('tko_iteration_perf_value', where)
527 self.delete('tko_iteration_attributes', where)
528 where['user_created'] = 0
529 self.delete('tko_test_attributes', where)
612 where={'hostname': machine_info['hostname']},
621 where = { 'hostname' : hostname }
622 rows = self.select('machine_idx', 'tko_machines', where)
704 where = {'job_idx': job_idx , 'test': testname, 'subdir': subdir}
705 rows = self.select('test_idx', 'tko_tests', where)
718 where = { 'job_idx':job_idx }
719 rows = self.select('test_idx', 'tko_tests', where)