[mod_python] mod_python & MySQLdb question: Done

Giampiero Benvenuti giampiero.benvenuti at chiaroscuro.com
Thu Dec 18 14:56:44 EST 2003


Thanks Manfred, now I'm starting to "see".
Great tip, it works like a "swiss" clock.

> This:
>
>> 	rows = cursor.fetchall()
>> 	rows = list(rows)
>> 	for row in rows:
>> 		results = (row['news_title']+',<br>')
>> 		req.write(results)
>
> can be compressed to (and made faster):
>
>
> results = []
> for row in cursor.fetchall():
> 	results.append(row['news_title'])
> req.write("<br />".join(results))
>



More information about the Mod_python mailing list