Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j8bxB-0006rT-ST for pgadmin-hackers@arkaria.postgresql.org; Mon, 02 Mar 2020 03:41:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j8bxA-0002OC-9q for pgadmin-hackers@arkaria.postgresql.org; Mon, 02 Mar 2020 03:41:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j8bx9-0002Nw-R0 for pgadmin-hackers@lists.postgresql.org; Mon, 02 Mar 2020 03:41:12 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j8bx4-00010L-Gf for pgadmin-hackers@lists.postgresql.org; Mon, 02 Mar 2020 03:41:10 +0000 Received: by mail-lj1-x236.google.com with SMTP id f13so1237179ljp.0 for ; Sun, 01 Mar 2020 19:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J6H7GdNNSc4tjeIa8rFqiAOVx2ackoLhPKA71i7D90c=; b=xNdjqExoUHy+BOG4aiqrJymPUrbo5zkgMsIzfUZK0E9o4vRSoJrNcdTu4Uf2Oof6hK 7yb7fGuwNopSJ6ru0TyBFvNNzNFiwXlqQRpss4YoQbh5OCS4lA3CASBnUc7auUCf/NqN ePgTicJkYZjFIxBXaIBMlZr3pK0E80tO2s2sOw8s48ODKH1h3nv/0PqYsuAjS7aDV3yU QefPn/8pWCFfEght6YFoLGE/rbPsXuWduw1I7FOQ9QwUi4TgxPuXWQ0JvoeYgBRJ3kb+ BOlgov7tU17NCI/ols0f5a8J1mTcwL1xkqeprWLpxXw4YBBnkcdiUAGT9GNdW9/ntqu9 BlqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J6H7GdNNSc4tjeIa8rFqiAOVx2ackoLhPKA71i7D90c=; b=V+h7S7S6UGYLlc+2tUrf1z8iN4AkVDZV/grslAsZIQJSb3/E01FFoz2ipxodcQgYeh SXiJw1o35oNib1LWLBppdqZFCTIXE9n0lPUxCZVnLOvOCHbE+gwapZLrfervEhq2aImp wDS/VOZS0qZnYJ/4nc13dVlKthPMGvNAaCUH/a6BJIX/Os4KhBjl9h1na+aN5JfTnz5I 3v0Mnz6MrBJUsJrIlhuVrAi6pJGBLP6ZPqgIsjorWDoQNimwMICeIfNX4dpX9DvmTXln puH8gU7vWUUWRRAOkcQb41SUpkmozLA1z2pIwLNg2yf3F7JbHzm798pKqYOlPerjd+Kg PjHg== X-Gm-Message-State: ANhLgQ1M54ZgBuRskq6PWbAIEMKgNvHaEX22tiNTHKrRZ/o1g8zRAK95 Mv29qtByCY4pjTkPlVjVjwELQ+ypHfA6VmdFLELlRRRhex4AuPUrVCqAvJ1xogjCM7qOYbIp/2I XPK3aTo+A1SQD3OKxG8vo41LePjOpUdVzmOkmlIhInOh3vbN7Rk/v30KlQsjhXb+qZGF+jTApYQ N3GyUI9AApuvPKagml+HTh22YGQlewZuRdyK/zO8oSuKF54R9joJ6oekSRXHykWqTHSBPk5FUT X-Google-Smtp-Source: ADFU+vubMQktRYgLwi5dwaSMiyF0tJrUX6rIYGDgnwDpCCu8MgQ7b2Qd1rF6pUPI60d2VIwyBpuW69yvjeTSiF+ylhE= X-Received: by 2002:a05:651c:111a:: with SMTP id d26mr9996052ljo.153.1583120463947; Sun, 01 Mar 2020 19:41:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Khushboo Vashi Date: Mon, 2 Mar 2020 09:10:56 +0530 Message-ID: Subject: Re: 'render_template' server_type/version resolution To: Radoslaw Garbacz Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000e4001e059fd6f4d3" X-CLOUD-SEC-AV-Info: edb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000e4001e059fd6f4d3 Content-Type: text/plain; charset="UTF-8" Hi, On Sat, Feb 29, 2020 at 1:56 AM Radoslaw Garbacz < radoslaw.garbacz@xtremedatainc.com> wrote: > Hi, > > I have a question regarding templates resolution from subdirectories based > on server version (and type) for 'SQL' templates (e.g. for > "get_encodinds.sql" in > "web/pgadmin/browser/server_groups/servers/databases/"). > > I created a subdirectory matching my pg like db version: > "web/pgadmin/browser/server_groups/servers/databases/templates/databases/sql/8.1_plus". > I have also a specific subdir for "server_type_version" (.../dbx_8.1_plus), > however the server does not seem to be able to find it, and always defaults > to ".../templates/databases/sql/default". > > pgAdmin does not support PostgreSQL absolute versions. However if you want to make local changes in the template loader mechanism, check the /web/pgadmin/utils/versioned_template_loader.py file to understand the template loader mapping logic. Thanks, Khushboo > When debugging, I get "self.template_path" as "databases/sql/#80102#" > (server_type: "dbx", however it's not used for "get_encodings"). > > So, I'd be grateful to hear how to make it find my modified > "get_encodings.sql"? > BTW: Is it OK if the directory is a link? > > -- > Best Regards, > > Radoslaw Garbacz > XtremeData Incorporated > --000000000000e4001e059fd6f4d3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

<= div dir=3D"ltr" class=3D"gmail_attr">On Sat, Feb 29, 2020 at 1:56 AM Radosl= aw Garbacz <radosl= aw.garbacz@xtremedatainc.com> wrote:
Hi,

I h= ave a question regarding templates resolution from subdirectories based on = server version (and type) for 'SQL' templates (e.g. for "get_e= ncodinds.sql" in "web/pgadmin/browser/server_groups/servers/datab= ases/").

I created a subdirectory matching my= pg like db version: "web/pgadmin/browser/server_groups/servers/databa= ses/templates/databases/sql/8.1_plus". I have also a specific subdir f= or "server_type_version" (.../dbx_8.1_plus), however the server d= oes not seem to be able to find it, and always defaults to ".../templa= tes/databases/sql/default".

pgAdmin does not support PostgreSQL absolute vers= ions. However if you want to make local changes in the template loader mech= anism,=C2=A0check the=C2=A0<pgAdmin Source Dir>/web/p= gadmin/utils/versioned_template_loader.py=C2=A0 file to understand the temp= late loader mapping logic.

Thanks,
Khushboo
When debugging, I get "self.template_path" as "= ;databases/sql/#80102#" (server_type: "dbx", however it'= s not used for "get_encodings").

So,= I'd be grateful to hear how to make it find my modified "get_enco= dings.sql"?=C2=A0
BTW: Is it OK = if the directory is a link?

--
Best Regards,
<= br>Radoslaw Garbacz
XtremeData Incorporated
<= /div>
--000000000000e4001e059fd6f4d3--