Closed chris-nlnz closed 7 years ago
The change is mentioned here in Django's release notes: https://docs.djangoproject.com/en/1.10/releases/1.8/#database-backend-api
"The data_types, data_types_suffix, and data_type_check_constraints attributes have moved from the DatabaseCreation class to DatabaseWrapper."
Fix my M. Chris in merge request #129.
Have an issue using django-pyodbc 1.0.0 with Django 1.8.15.
When saving (inserting) an object to a pyodbc database I get a
TypeError
when pyodbc tries to get thepk_db_type
(compiler.py line 533):Problem is that the
django.db.models.fields.Field.db_type
method in Django 1.8.15 tries to get the data_type from a different place than Django 1.7 did:Looking at pyodbc's code I see there is a data_types attribute on the DatabaseCreation model, but not on the DatabaseWrapper, whereas it seems to be the other way around with Django's built in DB engines. So this call fails as
connection.data_types
doesn't have any types in it, returnsNone
and the regexp split fails as it's not a string.Hope that makes sense, I don't know too much about django-pyodbc/Django database engine internals apart from what I discovered today so I apologise if I have misunderstood anything here.