Well, the patch below to v1898 for me. I can get things out of my database as a dictionary. So I'm happy. Someone spelled "uppercase" as "uupercase" in the code, so I fixed that too. I'm not sure what the best way to submit patches is, so please advise.

<!-- ~/Downloads/sqlalchemy tbrannon --> svn diff
Index: lib/sqlalchemy/databases/mssql.py
===================================================================
--- lib/sqlalchemy/databases/mssql.py    (revision 1898)
+++ lib/sqlalchemy/databases/mssql.py    (working copy)
@@ -105,6 +105,12 @@
         return "SMALLINT"
 
 class MSDateTime(sqltypes.DateTime):
+    def __init__(self, *args):
+        # sqltype.DateTime () only takes self and optionally timezone as args
+        # but it was being called with self and *args = [23, 3] leading to a
+        # an error. I therefore created a constructor and dropped all the
+        # arguments to that constructor and then called the parent constructor.
+        self = sqltypes.DateTime()
     def get_col_spec(self):
         return "DATETIME"
 
@@ -423,6 +429,9 @@
                 if a is not None:
                     args.append(a)
             coltype = ischema_names[type]
+            import pprint
+            print ("Calling %s with :" % coltype)
+            pprint.pprint(args)
             coltype = coltype(*args)
             colargs= []
             if default is not None:
@@ -450,10 +459,10 @@
                 ic.sequence = schema.Sequence(ic.name + '_identity')
 
         # Add constraints
-        RR = self.uupercase_table(ischema.ref_constraints )    #information_schema.referential_constraints
-        TC = self.uupercase_table(ischema.constraints)        #information_schema.table_constraints
-        C  = self.uupercase_table(ischema.column_constraints).alias('C') #information_schema.constraint_column_usage: the constrained column
-        R  = self.uupercase_table(ischema.column_constraints).alias('R') #information_schema.constraint_column_usage: the referenced column
+        RR = self.uppercase_table(ischema.ref_constraints)    #information_schema.referential_constraints
+        TC = self.uppercase_table(ischema.constraints)        #information_schema.table_constraints
+        C  = self.uppercase_table(ischema.column_constraints).alias('C') #information_schema.constraint_column_usage: the constrained column
+        R  = self.uppercase_table(ischema.column_constraints).alias('R') #information_schema.constraint_column_usage: the referenced column
 
         fromjoin = TC.join(RR, RR.c.constraint_name == TC.c.constraint_name ).join(C, C.c.constraint_name == RR.c.constraint_name)
         fromjoin = fromjoin.join(R, R.c.constraint_name == RR.c.unique_constraint_name)
<!-- ~/Downloads/sqlalchemy tbrannon -->
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to