hi, i have 2 tables both has "added_on"  field

i need last 'n'(lets assume n=5) rows from both tables ordered by added_on. 
it can be 1 from first table and 4 from second or 2|3

rows1 =db(db.table1).select(orderby=~db.table1.added_on, limitby=(0,5))
rows2 =db(db.table2).select(orderby=~db.table2.added_on, limitby=(0,5)) 

i need smth like this

 rows = rows1+rows2 
 rows->orderby(added_on)

 return dict(first 5 row in rows)

how to do this in a smarter way?


Reply via email to