Or if there might be multiple records tied for max hits:
max_select = db(db.videos)._select(db.videos.hits.max())
records = db(db.videos.hits.belongs(max_select)).select()
Anthony
On Monday, March 26, 2012 12:20:31 PM UTC-4, rochacbruno wrote:
>
> record = db(db.videos).select(orderby=~db.videos
record = db(db.videos).select(orderby=~db.videos.hits).first()
On Mon, Mar 26, 2012 at 1:11 PM, Hassan Alnatour wrote:
> Dear ALL ,
>
> I have a Table like this :
>
> db.define_table('Videos',
> Field('Title'),
> Field('File','upload'),
> Field('Hits','integer'))
>
>
> how can i get the record
Dear ALL ,
I have a Table like this :
db.define_table('Videos',
Field('Title'),
Field('File','upload'),
Field('Hits','integer'))
how can i get the record with the highest Hits ?
3 matches
Mail list logo