Skip to content

Commit 1e305ec

Browse files
committed
minor cleanup
1 parent 200894a commit 1e305ec

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

django_pyodbc/base.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
MS SQL Server database backend for Django.
33
"""
44

5+
import logging
6+
import os
7+
import re
8+
import warnings
9+
510
try:
611
import pyodbc as Database
712
except ImportError, e:
813
from django.core.exceptions import ImproperlyConfigured
914
raise ImproperlyConfigured("Error loading pyodbc module: %s" % e)
1015

11-
import re
1216
m = re.match(r'(\d+)\.(\d+)\.(\d+)(?:-beta(\d+))?', Database.version)
1317
vlist = list(m.groups())
1418
if vlist[3] is None: vlist[3] = '9999'
@@ -41,11 +45,11 @@
4145
from django_pyodbc.client import DatabaseClient
4246
from django_pyodbc.creation import DatabaseCreation
4347
from django_pyodbc.introspection import DatabaseIntrospection
44-
import os
45-
import warnings
4648

4749
warnings.filterwarnings('error', 'The DATABASE_ODBC.+ is deprecated', DeprecationWarning, __name__, 0)
4850

51+
logger = logging.getLogger(__name__)
52+
4953
try:
5054
if hasattr(settings, 'DATABASE_COLLATION'):
5155
warnings.warn(

django_pyodbc/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55

66
from datetime import datetime
7+
from django_pyodbc import aggregates as pyodbc_aggregates
78

89
REV_ODIR = {
910
'ASC': 'DESC',
@@ -36,8 +37,7 @@ def query_class(QueryClass):
3637
pass
3738

3839
class PyOdbcSSQuery(QueryClass):
39-
from django_pyodbc import aggregates
40-
aggregates_module = aggregates
40+
aggregates_module = pyodbc_aggregates
4141

4242
def __init__(self, *args, **kwargs):
4343
super(PyOdbcSSQuery, self).__init__(*args, **kwargs)

0 commit comments

Comments
 (0)