280 |
result.append(row[0]) |
result.append(row[0]) |
281 |
return result |
return result |
282 |
|
|
283 |
|
def Dependencies(self): |
284 |
|
"""Placeholder for a method in a derived class. |
285 |
|
|
286 |
|
Return a sequence with the tables and other data objects that |
287 |
|
self depends on. |
288 |
|
""" |
289 |
|
raise NotImplementedError |
290 |
|
|
291 |
|
|
292 |
class TransientTable(TransientTableBase): |
class TransientTable(TransientTableBase): |
293 |
|
|
355 |
names of the input tables without having to create prefixes. |
names of the input tables without having to create prefixes. |
356 |
""" |
""" |
357 |
TransientTableBase.__init__(self, transient_db) |
TransientTableBase.__init__(self, transient_db) |
358 |
|
self.dependencies = (left_table, right_table) |
359 |
self.left_table = left_table.transient_table() |
self.left_table = left_table.transient_table() |
360 |
self.left_field = left_field |
self.left_field = left_field |
361 |
self.right_table = right_table.transient_table() |
self.right_table = right_table.transient_table() |
397 |
self.orig_to_internal[self.right_field])) |
self.orig_to_internal[self.right_field])) |
398 |
self.db.execute(stmt) |
self.db.execute(stmt) |
399 |
|
|
400 |
|
def Dependencies(self): |
401 |
|
"""Return a tuple with the two tables the join depends on.""" |
402 |
|
return self.dependencies |
403 |
|
|
404 |
|
|
405 |
class AutoTransientTable(table.OldTableInterfaceMixin): |
class AutoTransientTable(table.OldTableInterfaceMixin): |
406 |
|
|
478 |
# Make sure to use the column object of the transient table. The |
# Make sure to use the column object of the transient table. The |
479 |
# left argument is always a column object so we can just ask the |
# left argument is always a column object so we can just ask the |
480 |
# t_table for the right object. |
# t_table for the right object. |
481 |
return self.t_table.SimpleQuery(self.t_table.Column(left.name), |
if hasattr(right, "name"): |
482 |
comparison, right) |
return self.t_table.SimpleQuery(self.t_table.Column(left.name), |
483 |
|
comparison, |
484 |
|
self.t_table.Column(right.name)) |
485 |
|
else: |
486 |
|
return self.t_table.SimpleQuery(self.t_table.Column(left.name), |
487 |
|
comparison, right) |
488 |
|
|
489 |
|
def Dependencies(self): |
490 |
|
"""Return a tuple containing the original table""" |
491 |
|
return (self.table,) |