Skip to content

Commit 752c0ea

Browse files
committed
add compatibility with old Django
1 parent 39128a7 commit 752c0ea

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

django_pyodbc/base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
4848
supports_transactions = True
4949
#uses_savepoints = True
5050

51+
def _supports_transactions(self):
52+
# keep it compatible with Django 1.3 and 1.4
53+
return self.supports_transactions
5154

5255
class DatabaseWrapper(BaseDatabaseWrapper):
5356
_DJANGO_VERSION = _DJANGO_VERSION

django_pyodbc/creation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ def _prepare_for_test_db_ddl(self):
120120
self.connection.connection.rollback()
121121
self.connection.connection.autocommit = True
122122

123+
def _rollback_works(self):
124+
# keep it compatible with Django 1.2
125+
return self.connection.features.supports_transactions
126+
123127
def sql_table_creation_suffix(self):
124128
suffix = []
125129
if self.connection.settings_dict['TEST_COLLATION']:

0 commit comments

Comments
 (0)