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;" |
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 |
|
|
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 |
|
|
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) |