Commits

NOKIA Development committed 2e4c724

[update] using a new attribute for pyodbc_encoding, PYODBC_ENCODING

Comments (0)

Files changed (1)

sql_server/pyodbc/base.py

 import warnings
 
 #http://code.google.com/p/django-pyodbc/issues/detail?id=78
-ENCODING = settings.DATABASE_OPTIONS['pyodbc_encoding'] if 'pyodbc_encoding' in settings.DATABASE_OPTIONS else 'utf-8'
+ENCODING = settings.PYODBC_ENCODING if hasattr(settings, 'PYODBC_ENCODING') else 'utf-8'
+
 
 warnings.filterwarnings('error', 'The DATABASE_ODBC.+ is deprecated', DeprecationWarning, __name__, 0)