If I use what you recommend then what would be the best way to generate the JSON output
Thanks Massimo On Saturday, May 12, 2012 12:29:09 AM UTC-4:30, Massimo Di Pierro wrote: > > No, but you can do > > for row in rows: row['count'] = row[count] > > > > On Friday, 11 May 2012 23:44:57 UTC-5, Franklin Freitas wrote: >> >> Having the following >> >> def by_country(): >> count = db.procesados.idpublicacion.count() >> rows = db().select(db.procesados.pais, count, >> groupby=db.procesados.pais) >> return rows.json() >> >> It generates the JSON: >> >> [{"pais": "", "COUNT(procesados.idpublicacion)": 236}, {"pais": "AE", >> "COUNT(procesados.idpublicacion)": 3}] >> >> >> Is there a way to assign an Alias to the COUNT field so I won't have that >> long name "COUNT(procesados.idpublicacion)" in the JSON output >> >> >> >> Thanks >> >>