Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbV1Z-00079f-Q2 for psycopg@arkaria.postgresql.org; Mon, 04 Apr 2022 22:18:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbV1Y-0006sS-GA for psycopg@arkaria.postgresql.org; Mon, 04 Apr 2022 22:18:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbV1X-0006sJ-Sf for psycopg@lists.postgresql.org; Mon, 04 Apr 2022 22:18:11 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbV1V-0008Pv-FI for psycopg@postgresql.org; Mon, 04 Apr 2022 22:18:10 +0000 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id B48432A0107 for ; Mon, 4 Apr 2022 15:18:07 -0700 (PDT) Date: Mon, 4 Apr 2022 15:18:07 -0700 (PDT) From: Rich Shepard To: psycopg@postgresql.org Subject: Re: cur.execute() syntax error [RESOLVED] In-Reply-To: <5D9AFC04-EF8C-401F-83EB-98976F898326@thebuild.com> Message-ID: References: <9471b149-dd21-5040-3693-c6f54ddc3b36@appl-ecosys.com> <5D9AFC04-EF8C-401F-83EB-98976F898326@thebuild.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 4 Apr 2022, Christophe Pettus wrote: > It looks like the LabelInput constructor includes some code. Did you mean something like: > > self.inputs['Contact Type'] = LabelInput( > ContactDataForm, 'contact_type',) > # query to fetch data from contacttypes table > fetch_all = "SELECT * from contacttypes" > cur.execute(fetch_all) > # fetching all rows > rows = cur.fetchall() > input_class=ttk.Combobox([values = rows]) > input_var=tk.StringVar() > # get selected value and bind it to a method > cont_type = self.get() # selected value by mouse click > con.close() Christophe, Sure looks like it. Thanks, Rich