Hey ty that helped enough to solve my problem
db((db.forum_post.category == db.category.id) & (db.category.id == forums.id)).select(db.forum_post.ALL, orderby=~db.forum_post.id, limitby=(0,1)) the "forums" value is a loop through the categories :-) *cheers ty very much for your help On Wed, Jan 4, 2012 at 8:38 PM, Anthony <abasta...@gmail.com> wrote: > Do you have a particular category to select from? If so, you need to add > that condition to your query. Assuming some_id is the id of the category > you want: > > db((db.forum_post.category == db.category.id) & (db.category.id == > some_id)).select(db.**foru**m_post.ALL, orderby=~db.forum_post.id > , limitby=(0,1)) > > Or are you trying to do something else? > > Anthony > > > On Wednesday, January 4, 2012 9:04:01 PM UTC-5, Andrew wrote: > >> Hi no its not on GAE >> >> I do get the last post but its for the last category posted in here is a >> link you can see :-) >> >> http://www.fireflywra.com/**forum <http://www.fireflywra.com/forum> >> >> *cheers >> >> >> On Wed, Jan 4, 2012 at 5:10 PM, Anthony <abas...@gmail.com> wrote: >> >>> What do you get with that query? Is this on GAE (on GAE, I don't think >>> the id's are necessarily in order)? >>> >>> >>> On Wednesday, January 4, 2012 6:20:36 PM UTC-5, Andrew wrote: >>>> >>>> In some forum code, I am trying to select the latest thread specific >>>> to a forum category. But I am unsure how to do this >>>> >>>> Any ideas are greatly appreciated >>>> >>>> This is the code I tried with >>>> >>>> {{last_posts = db(db.forum_post.category == >>>> db.category.id).select(db.**foru**m_post.ALL, orderby=~db.forum_post.id, >>>> >>>> limitby=(0,1))}} >>> >>> >>