lionheart / django-pyodbc

An ODBC-powered MS SQL Server DB backend for Django 1.4+
Apache License 2.0
202 stars 102 forks source link

In _fix_aggregates, use annotation_select (newer) if available else a… #146

Closed benmehlman closed 6 years ago

benmehlman commented 7 years ago

…ggregate_select

As reported by OrangeDog23 ( https://github.com/OrangeDog23 ) in issue #138 ( https://github.com/lionheart/django-pyodbc/issues/138 ), django-pyodbc raises an AttributeError due to the removal of aggregate_select in django 1.10.

In order to get my django application working I've patched my fork of django-pyodbc as suggested by OrangeDog23 and the solution seems to work.

Unfortunately I do not have the required knowledge of django's database internals to be able to offer real assurance that this patch is sound. But it is working for me, and I have tried to make it as backward compatible as possible. Perhaps OrangeDog23 can comment as to the wisdom of including this patch into the project.

Thanks! Ben Mehlman

dlo commented 6 years ago

There doesn't seem to be any downside to merging this patch in. Thanks @original-montyskew for the review and testimonial re: usage. New release going out in a few minutes. 👍

dlo commented 6 years ago

Also, thank you @benmehlman for the patch!