def export_all ( self ) : query = """
			SELECT quote, library, logid
			from quotes
			left outer join quote_log on quotes.quoteid = quote_log.quoteid
			""" fields = 'text' , 'library' , 'log_id' return ( dict ( zip ( fields , res ) ) for res in self . db . execute ( query ) )
python how to represent sql queries in a data structure
def export_all(self):
		query = """
			SELECT quote, library, logid
			from quotes
			left outer join quote_log on quotes.quoteid = quote_log.quoteid
			"""
		fields = 'text', 'library', 'log_id'
		return (dict(zip(fields, res)) for res in self.db.execute(query))