Re: [web2py] Re: Select X random from returned list

2012-01-20 Thread Bruce Wade
Ok thanks Massimo. On Fri, Jan 20, 2012 at 5:09 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > yes. :-) > > On Jan 20, 5:48 pm, Bruce Wade wrote: > > Would this be the best approach: > > todays_ids = set(used_ad_ids) > > unseen_ads_query = self.db(~self.db.ads.id.be

[web2py] Re: Select X random from returned list

2012-01-20 Thread Massimo Di Pierro
yes. :-) On Jan 20, 5:48 pm, Bruce Wade wrote: > Would this be the best approach: >         todays_ids = set(used_ad_ids) >         unseen_ads_query = self.db(~self.db.ads.id.belongs(todays_ids)) >         unseen_ads_query = unseen_ads_query(self.db.ads.points >= 0) >         unseen_ads_query = u

[web2py] Re: Select X random from returned list

2012-01-20 Thread Bruce Wade
Would this be the best approach: todays_ids = set(used_ad_ids) unseen_ads_query = self.db(~self.db.ads.id.belongs(todays_ids)) unseen_ads_query = unseen_ads_query(self.db.ads.points >= 0) unseen_ads_query = unseen_ads_query(self.db.ads.viewable == True) unsee