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 2525from django .db .backends .signals import connection_created
2626from django .conf import settings
2727from 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
3536elif DjangoVersion [:2 ] == (1 ,1 ):
3637 _DJANGO_VERSION = 11
3738elif DjangoVersion [:2 ] == (1 ,0 ):
3839 _DJANGO_VERSION = 10
39- elif DjangoVersion [0 ] == 1 :
40- _DJANGO_VERSION = 13
4140else :
4241 _DJANGO_VERSION = 9
4342
@@ -85,6 +84,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
8584
8685
8786class DatabaseWrapper (BaseDatabaseWrapper ):
87+ _DJANGO_VERSION = _DJANGO_VERSION
8888 drv_name = None
8989 driver_needs_utf8 = None
9090 MARS_Connection = False
Original file line number Diff line number Diff line change @@ -165,7 +165,10 @@ def _as_sql(self, strategy):
165165 result .append ('WHERE %s' % where )
166166 params .extend (w_params )
167167
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 ()
169172 if grouping :
170173 if ordering :
171174 # If the backend can't group by PK (i.e., any database
You can’t perform that action at this time.
0 commit comments