Commits

Anonymous committed 461851e

[svn r110] Initial SQL Server support using pyodbc (#46)

  • Participants
  • Parent commits 8cd2166
  • Branches trunk

Comments (0)

Files changed (2)

File db/sql_server/__init__.py

Empty file added.

File db/sql_server/pyodbc.py

+from django.db import connection
+from django.db.models.fields import *
+from south.db import generic
+
+class DatabaseOperations(generic.DatabaseOperations):
+    """
+    django-pyodbc (sql_server.pyodbc) implementation of database operations.
+    """
+
+    def create_table(self, table_name, fields):
+        # Tweak stuff as needed
+        for name,f in fields:
+            if isinstance(f, BooleanField):
+                if f.default == True:
+                    f.default = 1
+                if f.default == False:
+                    f.default = 0
+
+        # Run
+        generic.DatabaseOperations.create_table(self, table_name, fields)