/[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 818 by bh, Mon May 5 17:18:31 2003 UTC revision 839 by bh, Tue May 6 15:54:18 2003 UTC
# Line 155  class TransientTableBase(table.OldTableI Line 155  class TransientTableBase(table.OldTableI
155      def Column(self, col):      def Column(self, col):
156          return self.column_map[col]          return self.column_map[col]
157    
158        def HasColumn(self, col):
159            """Return whether the table has a column with the given name or index
160            """
161            return self.column_map.has_key(col)
162    
163      def ReadRowAsDict(self, index):      def ReadRowAsDict(self, index):
164          if self.read_record_cursor is None or index <self.read_record_last_row:          if self.read_record_cursor is None or index <self.read_record_last_row:
165              stmt = ("SELECT %s FROM %s;"              stmt = ("SELECT %s FROM %s;"
# Line 313  class AutoTransientTable(table.OldTableI Line 318  class AutoTransientTable(table.OldTableI
318      def Column(self, col):      def Column(self, col):
319          return self.table.Column(col)          return self.table.Column(col)
320    
321        def HasColumn(self, col):
322            """Return whether the table has a column with the given name or index
323            """
324            return self.table.HasColumn(col)
325    
326      def NumRows(self):      def NumRows(self):
327          return self.table.NumRows()          return self.table.NumRows()
328    
# Line 323  class AutoTransientTable(table.OldTableI Line 333  class AutoTransientTable(table.OldTableI
333          """Return the record no. record as a dict mapping field names to values          """Return the record no. record as a dict mapping field names to values
334          """          """
335          if self.t_table is not None:          if self.t_table is not None:
336              return self.t_table.read_record(record)              return self.t_table.ReadRowAsDict(record)
337          else:          else:
338              return self.table.ReadRowAsDict(record)              return self.table.ReadRowAsDict(record)
339    
# Line 342  class AutoTransientTable(table.OldTableI Line 352  class AutoTransientTable(table.OldTableI
352      def ValueRange(self, col):      def ValueRange(self, col):
353          if self.t_table is None:          if self.t_table is None:
354              self.copy_to_transient()              self.copy_to_transient()
355          (min, row), (max, row) = self.t_table.field_range(col)          return self.t_table.ValueRange(col)
         return min, max  
356    
357      def UniqueValues(self, colname):      def UniqueValues(self, col):
358          if self.t_table is None:          if self.t_table is None:
359              self.copy_to_transient()              self.copy_to_transient()
360          return self.t_table.GetUniqueValues(colname)          return self.t_table.UniqueValues(col)

Legend:
Removed from v.818  
changed lines
  Added in v.839

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26