/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/transientdb.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/transientdb.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 849 by bh, Wed May 7 11:55:31 2003 UTC revision 984 by bh, Thu May 22 16:37:48 2003 UTC
# Line 280  class TransientTableBase(table.OldTableI Line 280  class TransientTableBase(table.OldTableI
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    
# Line 347  class TransientJoinedTable(TransientTabl Line 355  class TransientJoinedTable(TransientTabl
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()
# Line 388  class TransientJoinedTable(TransientTabl Line 397  class TransientJoinedTable(TransientTabl
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    
# Line 465  class AutoTransientTable(table.OldTableI Line 478  class AutoTransientTable(table.OldTableI
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,)

Legend:
Removed from v.849  
changed lines
  Added in v.984

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26