|
33 | 33 | _DJANGO_VERSION = 13 |
34 | 34 | elif DjangoVersion[:2] == (1,2): |
35 | 35 | _DJANGO_VERSION = 12 |
36 | | -elif DjangoVersion[:2] == (1,1): |
37 | | - _DJANGO_VERSION = 11 |
38 | | -elif DjangoVersion[:2] == (1,0): |
39 | | - _DJANGO_VERSION = 10 |
40 | 36 | else: |
41 | | - _DJANGO_VERSION = 9 |
| 37 | + raise ImproperlyConfigured("Django %d.%d is not supported." % DjangoVersion[:2]) |
42 | 38 |
|
43 | 39 | from django_pyodbc.operations import DatabaseOperations |
44 | 40 | from django_pyodbc.client import DatabaseClient |
|
49 | 45 |
|
50 | 46 | logger = logging.getLogger(__name__) |
51 | 47 |
|
| 48 | +collation = 'Latin1_General_CI_AS' |
52 | 49 | try: |
53 | 50 | if hasattr(settings, 'DATABASE_COLLATION'): |
54 | 51 | warnings.warn( |
|
59 | 56 | elif 'collation' in settings.DATABASE_OPTIONS: |
60 | 57 | collation = settings.DATABASE_OPTIONS['collation'] |
61 | 58 | except AttributeError: |
62 | | - collation = 'Latin1_General_CI_AS' |
| 59 | + pass |
63 | 60 |
|
64 | 61 | deprecated = ( |
65 | 62 | ('DATABASE_ODBC_DRIVER', 'driver'), |
|
77 | 74 | IntegrityError = Database.IntegrityError |
78 | 75 |
|
79 | 76 | class DatabaseFeatures(BaseDatabaseFeatures): |
80 | | - uses_custom_query_class = True |
81 | 77 | can_use_chunked_reads = False |
82 | 78 | can_return_id_from_insert = True |
83 | 79 | #uses_savepoints = True |
@@ -141,10 +137,7 @@ def __init__(self, *args, **kwargs): |
141 | 137 | self.client = DatabaseClient(self) |
142 | 138 | self.creation = DatabaseCreation(self) |
143 | 139 | self.introspection = DatabaseIntrospection(self) |
144 | | - if _DJANGO_VERSION >= 12: |
145 | | - self.validation = BaseDatabaseValidation(self) |
146 | | - else: |
147 | | - self.validation = BaseDatabaseValidation() |
| 140 | + self.validation = BaseDatabaseValidation(self) |
148 | 141 |
|
149 | 142 | self.connection = None |
150 | 143 |
|
|
0 commit comments