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
groupby instead of group_by
db(db.power_curve).select(orderby=~db.power.id,
group_by=db.power_curve.site)
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(
4 matches
Mail list logo