Skip to content
This repository was archived by the owner on Aug 7, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions sql_server/pyodbc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,23 @@
from django.db.backends.signals import connection_created
from django.conf import settings
from django import VERSION as DjangoVersion
if DjangoVersion[:2] == (1,4):
# Django version 1.4 adds a backwards incompatible change to
# DatabaseOperations
_DJANGO_VERSION = 14
elif DjangoVersion[:2] == (1,2) :

"""Versioning script - removed hardcoded versioning
!!!Support for Django versions <1.0 is now dropped!!!"""

_DJANGO_VERSION = str(DjangoVersion[0]) + str(DjangoVersion[1])
_DJANGO_VERSION=int(_DJANGO_VERSION)


if _DJANGO_VERSION == 12:
from django import get_version
version_str = get_version()
if 'SVN' in version_str and int(version_str.split('SVN-')[-1]) < 11952: # django trunk revision 11952 Added multiple database support.

if 'SVN' in version_str and int(version_str.split('SVN-')[-1]) < 11952:
_DJANGO_VERSION = 11
else:
_DJANGO_VERSION = 12
elif DjangoVersion[:2] == (1,1):
_DJANGO_VERSION = 11
elif DjangoVersion[:2] == (1,0):
_DJANGO_VERSION = 10
elif DjangoVersion[0] == 1:
_DJANGO_VERSION = 13
else:
_DJANGO_VERSION = 9


from sql_server.pyodbc.operations import DatabaseOperations
from sql_server.pyodbc.client import DatabaseClient
from sql_server.pyodbc.creation import DatabaseCreation
Expand Down
3 changes: 2 additions & 1 deletion sql_server/pyodbc/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def _as_sql(self, strategy):
result.append('WHERE %s' % where)
params.extend(w_params)

grouping, gb_params = self.get_grouping()
#fixed ordering group - thanks Elessar Webb from GitHub
grouping, gb_params = self.get_grouping(ordering_group_by)
if grouping:
if ordering:
# If the backend can't group by PK (i.e., any database
Expand Down