File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 25
25
from django .db .backends .signals import connection_created
26
26
from django .conf import settings
27
27
from django import VERSION as DjangoVersion
28
- if DjangoVersion [:2 ] == (1 ,2 ):
29
- from django import get_version
30
- version_str = get_version ()
31
- if 'SVN' in version_str and int (version_str .split ('SVN-' )[- 1 ]) < 11952 : # django trunk revision 11952 Added multiple database support.
32
- _DJANGO_VERSION = 11
33
- else :
34
- _DJANGO_VERSION = 12
28
+ if DjangoVersion [:2 ] >= (1 ,5 ):
29
+ _DJANGO_VERSION = 15
30
+ elif DjangoVersion [:2 ] == (1 ,4 ):
31
+ _DJANGO_VERSION = 14
32
+ elif DjangoVersion [:2 ] == (1 ,3 ):
33
+ _DJANGO_VERSION = 13
34
+ elif DjangoVersion [:2 ] == (1 ,2 ):
35
+ _DJANGO_VERSION = 12
35
36
elif DjangoVersion [:2 ] == (1 ,1 ):
36
37
_DJANGO_VERSION = 11
37
38
elif DjangoVersion [:2 ] == (1 ,0 ):
38
39
_DJANGO_VERSION = 10
39
- elif DjangoVersion [0 ] == 1 :
40
- _DJANGO_VERSION = 13
41
40
else :
42
41
_DJANGO_VERSION = 9
43
42
@@ -85,6 +84,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
85
84
86
85
87
86
class DatabaseWrapper (BaseDatabaseWrapper ):
87
+ _DJANGO_VERSION = _DJANGO_VERSION
88
88
drv_name = None
89
89
driver_needs_utf8 = None
90
90
MARS_Connection = False
Original file line number Diff line number Diff line change @@ -165,7 +165,10 @@ def _as_sql(self, strategy):
165
165
result .append ('WHERE %s' % where )
166
166
params .extend (w_params )
167
167
168
- grouping , gb_params = self .get_grouping (ordering_group_by )
168
+ if self .connection ._DJANGO_VERSION >= 15 :
169
+ grouping , gb_params = self .get_grouping (ordering_group_by )
170
+ else :
171
+ grouping , gb_params = self .get_grouping ()
169
172
if grouping :
170
173
if ordering :
171
174
# If the backend can't group by PK (i.e., any database
You can’t perform that action at this time.
0 commit comments