From: Mark Huang Date: Thu, 9 Nov 2006 19:34:04 +0000 (+0000) Subject: - selectall: key_field implies hashref X-Git-Tag: pycurl-7_13_1~337 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=30b0bba06704908449587618fb40fe05d902f953;p=plcapi.git - selectall: key_field implies hashref --- diff --git a/PLC/PostgreSQL.py b/PLC/PostgreSQL.py index fa5f1cfb..30e9c461 100644 --- a/PLC/PostgreSQL.py +++ b/PLC/PostgreSQL.py @@ -5,7 +5,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: PostgreSQL.py,v 1.8 2006/10/30 16:37:49 mlhuang Exp $ +# $Id: PostgreSQL.py,v 1.9 2006/11/08 22:43:02 mlhuang Exp $ # import psycopg2 @@ -178,7 +178,7 @@ class PostgreSQL: self.execute(query, params) rows = self.cursor.fetchall() - if hashref: + if hashref or key_field is not None: # Return each row as a dictionary keyed on field name # (like DBI selectrow_hashref()). labels = [column[0] for column in self.description]