From 73585495249167153e4cd277d37f1603b1913e62 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Mon, 4 Jan 2016 13:41:57 +0530 Subject: [PATCH] Allow to specify the number of arguments in the qtTypeIdent to make it work with schema specified object name. You can use the qtTypeIdent template filter as: conn|qtTypeIdent(name) or, conn|qtTypeIdent(schema_name, name) --- web/pgadmin/utils/driver/psycopg2/__init__.py | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py index fcfc3f3b8..5e325e376 100644 --- a/web/pgadmin/utils/driver/psycopg2/__init__.py +++ b/web/pgadmin/utils/driver/psycopg2/__init__.py @@ -845,18 +845,25 @@ class Driver(BaseDriver): return True @staticmethod - def qtTypeIdent(value): + def qtTypeIdent(conn, *args): + # We're not using the conn object at the moment, but - we will modify the + # logic to use the server version specific keywords later. + res = None + value = None - if (len(value) == 0): - return value + for val in args: + if len(val) == 0: + continue - result = value; + value = val - if (Driver.needsQuoting(result, True)): - result.replace("\"", "\"\"") - return "\"" + result + "\"" - else: - return result + if (Driver.needsQuoting(val, True)): + value.replace("\"", "\"\"") + value = "\"" + value + "\"" + + res = ((res and res + '.') or '') + value + + return res @staticmethod def qtIdent(conn, *args):