Vincenzo,

You may get exceptions from the database driver if the id list is empty. 
 Using Postgres, I do something like this:

ids = db()._select(db.users_keywords.keyword_id, distinct=True) 
if len(ids):
  db((~db.keyword.id.belongs(ids)) & (db.keyword.dictionary == 
dictionary)). 
  delete() 


On Monday, May 14, 2012 2:14:44 AM UTC-4, Vincenzo Ampolo wrote:
>
> On 05/13/2012 02:50 PM, Anthony wrote: 
> > ids = db()._select(db.users_keywords.keyword_id, distinct=True) 
> > db((~db.keyword.id.belongs(ids)) & (db.keyword.dictionary == 
> dictionary)). 
> > delete() 
> > 
> > Anthony 
>
> Thanks a lot! 
>
> This is exactly what I was looking for! 
>
> -- 
> Vincenzo Ampolo 
> http://vincenzo-ampolo.net 
> http://goshawknest.wordpress.com 
>

Reply via email to