Create a table using a list of column definitions given in columndefs. generator must be a function taking arguments (row_number, col_number) returning a suitable data object for insertion into the table.
(self, columndefs)
| 63 | i = i + 1 |
| 64 | |
| 65 | def create_table(self, columndefs): |
| 66 | |
| 67 | """ Create a table using a list of column definitions given in |
| 68 | columndefs. |
| 69 | |
| 70 | generator must be a function taking arguments (row_number, |
| 71 | col_number) returning a suitable data object for insertion |
| 72 | into the table. |
| 73 | |
| 74 | """ |
| 75 | self.table = self.new_table_name() |
| 76 | self.cursor.execute('CREATE TABLE %s (%s) %s' % |
| 77 | (self.table, |
| 78 | ',\n'.join(columndefs), |
| 79 | self.create_table_extra)) |
| 80 | |
| 81 | def check_data_integrity(self, columndefs, generator): |
| 82 | # insert |