andymckay/django-statsd — pull request #50 by jawnb (2014-04-26 20:51:57+00:00)
Title: Fix issue where db timings were not being patched properly for django 1.6

The __getattr__ method previously implemented in django_statsd.patches.db does not function the same as CursorWrapper.__getattr__ in django 1.6. This is causing db timings to not be populated when DEBUG = False.

I ended up just making wrap_class generic enough to account for CursorDebugWrapper and CursorWrapper, as I feel it is a cleaner implementation. This also eliminates the partial() creation on each execute/executemany call.

I tested this against django 1.5.1 and 1.6.3, both worked as expected.