From bd5a767ffae85e9ff2b3773cdf27262643910553 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 23 Mar 2016 11:25:34 -0500 Subject: [PATCH] added support for newer newrelic --- CHANGES | 2 +- pydal/adapters/postgres.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 58598d157..0886b8fc2 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,7 @@ Released on March 23rd 2016 - Faster SQLite logic in absence of db queris - PEP8 improvements -- Added support for new relic +- Added support for new relic (newrelic>=2.10.0.8) - Added support for outerscoped tablenames - fixed Google Cloud SQL support - fixed Oracle DB support diff --git a/pydal/adapters/postgres.py b/pydal/adapters/postgres.py index 5eb570fa7..14bc75766 100644 --- a/pydal/adapters/postgres.py +++ b/pydal/adapters/postgres.py @@ -50,8 +50,8 @@ def varquote(self, name): def adapt(self, obj): if self.driver_name == 'psycopg2': adapted = psycopg2_adapt(obj) - # deal with new relic Connection Wrapper - cxn = getattr(self.connection,'_nr_connection',self.connection) + # deal with new relic Connection Wrapper (newrelic>=2.10.0.8) + cxn = getattr(self.connection,'__wrapped__',self.connection) adapted.prepare(cxn) rv = adapted.getquoted() if not PY2: