Re: [web2py] help on a query

2011-06-09 Thread Manuele Pesenti
On 09/06/2011 12:50, Vasile Ermicioi wrote: db(db.power_curve).select(orderby=~db.power.id, group_by=db.power_curve.site) no, it doesn't get the expected result at the moment I solved filtering the query in a second time using another query that involves a max function: last_pc = db.power_c

Re: [web2py] help on a query

2011-06-09 Thread Vasile Ermicioi
groupby instead of group_by

Re: [web2py] help on a query

2011-06-09 Thread Vasile Ermicioi
db(db.power_curve).select(orderby=~db.power.id, group_by=db.power_curve.site)

[web2py] help on a query

2011-06-09 Thread Manuele Pesenti
defining a table like that db.define_table('power_curve', Field('site', db.site, notnull=True, requires = IS_IN_DB(db, 'site.id', '%(name)s')), Field('file_name', 'upload', uploadfield=True, notnull=True, required=True), Field('validity', 'date', default=datetime.date(