]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added keys() to ColumnParameters, needed for setbindparamsizes traversal
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 28 Mar 2007 23:30:22 +0000 (23:30 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 28 Mar 2007 23:30:22 +0000 (23:30 +0000)
lib/sqlalchemy/sql.py
test/sql/labels.py

index 9bdbc0cb8cc8962a799b2ad3988f34a8f823983b..b9e9896a84f1f9c0ede8f51f8a033a21b5d16801 100644 (file)
@@ -475,7 +475,10 @@ class ClauseParameters(object):
         bind = self.binds[key]
         value = self.binds_to_values[bind]
         return bind.typeprocess(value, self.dialect)
-    
+   
+    def keys(self):
+        return self.binds_to_names.values()
     def __getitem__(self, key):
         return self.get_processed(key)
         
index a2e899ed6e793523f8cd98cda3eb75cc2b460741..53022a6a02a900b1256f378932e2f85e8315b3f9 100644 (file)
@@ -10,7 +10,7 @@ class LongLabelsTest(testbase.PersistTest):
         global metadata, table1
         metadata = MetaData(engine=testbase.db)
         table1 = Table("some_large_named_table", metadata,
-            Column("this_is_the_primarykey_column", Integer, primary_key=True),
+            Column("this_is_the_primarykey_column", Integer, Sequence("this_is_some_large_seq"), primary_key=True),
             Column("this_is_the_data_column", String(30))
             )
         metadata.create_all()
@@ -26,7 +26,7 @@ class LongLabelsTest(testbase.PersistTest):
         table1.insert().execute(**{"this_is_the_primarykey_column":3, "this_is_the_data_column":"data3"})
         table1.insert().execute(**{"this_is_the_primarykey_column":4, "this_is_the_data_column":"data4"})
 
-        r = table1.select(use_labels=True).execute()
+        r = table1.select(use_labels=True, order_by=[table1.c.this_is_the_primarykey_column]).execute()
         result = []
         for row in r:
             result.append((row[table1.c.this_is_the_primarykey_column], row[table1.c.this_is_the_data_column]))
@@ -35,7 +35,7 @@ class LongLabelsTest(testbase.PersistTest):
             (2, "data2"),
             (3, "data3"),
             (4, "data4"),
-        ]
+        ], repr(result)
     
     def test_colbinds(self):
         table1.insert().execute(**{"this_is_the_primarykey_column":1, "this_is_the_data_column":"data1"})
@@ -64,4 +64,4 @@ class LongLabelsTest(testbase.PersistTest):
         print str(x)
         
 if __name__ == '__main__':
-    testbase.main()
\ No newline at end of file
+    testbase.main()