1. Enrique Juan de Dios
  2. django-mssql


adamv  committed 95666aa

  • Participants
  • Parent commits 5621db1
  • Branches default

Comments (0)

Files changed (2)

File README.txt

View file
 path, visible to both Django and the command-line tools. This could be in 
 your lib/site_packages, django/db/backends (if you don't mind mixing in 
 external code), or anywhere else on the Python path.
+== References ==
+  * Project site: http://code.google.com/p/django-mssql/
+  * DB-API 2.0 specification: http://www.python.org/dev/peps/pep-0249/

File source/sqlserver_ado/dbapi.py

View file
-"""adodbapi v2.1D -  A (mostly) Python DB API 2.0 interface to Microsoft ADO
+"""A DB API 2.0 interface to SQL Server for Django
-Python's DB-API 2.0: http://www.python.org/dev/peps/pep-0249/
-Copyright (C) 2002  Henrik Ekelund
+Forked from: adodbapi v2.1
+Copyright (C) 2002 Henrik Ekelund, version 2.1 by Vernon Cole
+* http://adodbapi.sourceforge.net/
+* http://sourceforge.net/projects/pywin32/
 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-* Version 2.1 by Vernon Cole
-* Version 2.1D by Adam Vandenberg (forked for internal Django backend use)
-  Note that this file acts as a db-api 2 interface for ADO, but is rather 
-  SQL Server and Django specific now, and probaby won't work against other 
-  ADO backends anymore.
+* Version 2.1D by Adam Vandenberg, forked for Django backend use.
+  This module is a db-api 2 interface for ADO, but is Django & SQL Server. 
+  It won't work against other ADO sources (like Access.)
+DB-API 2.0 specification: http://www.python.org/dev/peps/pep-0249/
 import sys
 # expects '%s' parameters. This wrapper takes care of the conversion.
 paramstyle = 'format'
-version = __doc__.split('-',2)[0]
 #  Set defaultIsolationLevel on module level before creating the connection.
 #   It may be one of "adXact..." consts.
 defaultIsolationLevel = adXactReadCommitted
-        p = self.cmd.Parameters(0)
-        self.return_value = _convert_to_python(p.Value, p.Type)
+        p_return_value = self.cmd.Parameters(0)
+        self.return_value = _convert_to_python(p_return_value.Value, p_return_value.Type)
         return [_convert_to_python(p.Value, p.Type)
             for p in tuple(self.cmd.Parameters)[1:] ]
         if self.rs.State == adStateClosed or self.rs.BOF or self.rs.EOF:
-            if rows == 1: # fetchone can return None
+            if rows == 1: # fetchone returns None
                 return None
             else: # fetchall and fetchmany return empty lists
                 return list()