[BangPypers] Adding MS SQL support to Web.py 0.23
jace at pobox.com
Wed May 28 17:14:28 CEST 2008
I recently needed to use Web.py with MS SQL on a Windows server.
Web.py doesn't support SQL Server, but it's a trivial patch using the
excellent module from pymssql.sf.net.
Anand, I've also reported this as a bug+patch at Launchpad. Hope it
can be incorporated.
=== modified file 'web/db.py'
--- web/db.py 2008-01-03 17:36:15 +0000
+++ web/db.py 2008-05-19 08:10:14 +0000
@@ -304,6 +304,14 @@
keywords['database'] = keywords['db']
+ elif dbn == "mssql":
+ import pymssql as db
+ if 'pw' in keywords:
+ keywords['password'] = keywords['pw']
+ del keywords['pw']
+ keywords['database'] = keywords['db']
+ del keywords['db']
raise UnknownDB, dbn
More information about the BangPypers