From 73013914e7eae2a0480492ece085b48c5938dd84 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 17 Dec 2013 15:13:39 -0500 Subject: - rework JSON expressions to be based off __getitem__ exclusively - add support for "standalone" JSON objects; this involves getting CAST to upgrade the given type of a bound parameter. should add a core-only test for this. - add tests for "standalone" json round trips both with and without unicode - add mechanism by which we remove psycopg2's "json" handler in order to get the effect of using our non-native result handlers --- lib/sqlalchemy/dialects/postgresql/psycopg2.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2.py') diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 4a9248e5f..ceb04b580 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -179,7 +179,7 @@ from .base import PGDialect, PGCompiler, \ ENUM, ARRAY, _DECIMAL_TYPES, _FLOAT_TYPES,\ _INT_TYPES from .hstore import HSTORE -from .pgjson import JSON +from .json import JSON logger = logging.getLogger('sqlalchemy.dialects.postgresql') @@ -236,9 +236,7 @@ class _PGHStore(HSTORE): class _PGJSON(JSON): - # I've omitted the bind processor here because the method of serializing - # involves registering specific types to auto-serialize, and the adapter - # just a thin wrapper over json.dumps. + def result_processor(self, dialect, coltype): if dialect._has_native_json: return None -- cgit v1.2.1