All pastes #491245 Raw Edit

Untitled

public python v1 · immutable
·published 2007-05-16 15:10 UTC
rendered paste body
    def query(self, query):        """        @return: a list of dictionary        """        try:            logging.debug('PyDb:\n%s\n' % query)            self.execute(query)        except PgSQL.DatabaseError, value:            import pdb            pdb.set_trace()            self.connection.rollback ()#            print str(query)#            raise "ERROR EXECUTE CMD (%s) %s" % (str(query), value)        else:            try:                return _transcode([dict(row) for row in self.cursor.fetchall()])            except PgSQL.Error, e:                import pdb                pdb.set_trace()                if str(e) == 'fetchall() Failed - cursor does not contain any rows.':                    return []                raise e