Treat columns as ordered throughout code

The set() does not make anything any easier,
lists are closer to underlying representation.
This commit is contained in:
Stefan Wehrmeyer
2014-01-31 20:42:04 +01:00
parent 89ebd62732
commit 8f4cd59c9a
3 changed files with 8 additions and 6 deletions
+5 -2
View File
@@ -25,7 +25,7 @@ class Table(object):
"""
Get a listing of all columns that exist in the table.
"""
return set(self.table.columns.keys())
return list(self.table.columns.keys())
def drop(self):
"""
@@ -184,7 +184,10 @@ class Table(object):
self.database.executable.execute(stmt)
def _ensure_columns(self, row, types={}):
for column in set(row.keys()) - set(self.table.columns.keys()):
# Keep order of inserted columns
for column in row.keys():
if column in self.table.columns.keys():
continue
if column in types:
_type = types[column]
else: