From: Michael Trier Date: Fri, 23 Jan 2009 01:45:20 +0000 (+0000) Subject: Correction to reflection fix r5718 to handle Binary / other numeric types. X-Git-Tag: rel_0_5_2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=84a38c81e4c1f36c82fe1f78fafb6dcd72a7b8db;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Correction to reflection fix r5718 to handle Binary / other numeric types. --- diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index ae36125130..90021b1d65 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -1151,14 +1151,14 @@ class MSSQLDialect(default.DefaultDialect): coltype = self.ischema_names.get(type, None) kwargs = {} - if coltype in (MSString, MSChar, MSNVarchar, MSNChar, MSText, MSNText): + if coltype in (MSString, MSChar, MSNVarchar, MSNChar, MSText, MSNText, MSBinary, MSVarBinary, sqltypes.Binary): kwargs['length'] = charlen if collation: kwargs['collation'] = collation if coltype == MSText or (coltype in (MSString, MSNVarchar) and charlen == -1): kwargs.pop('length') - if coltype in (MSNumeric,): # TODO: include MSMoney? + if issubclass(coltype, sqltypes.Numeric): kwargs['scale'] = numericscale kwargs['precision'] = numericprec