Skip to content

Instantly share code, notes, and snippets.

@larsks
Created May 23, 2009 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsks/116468 to your computer and use it in GitHub Desktop.
Save larsks/116468 to your computer and use it in GitHub Desktop.
Just to be painfully complete the solution was:
subquery = select([Taggable.c.id], query._criterion, from_obj= query._from_obj).as_scalar()
names.select (exists ([names.c.id], and_(names.c.id == obj_tags.c.name_id, obj_tags.c.parent_id==Taggable.c.id , Taggable.c.id.in_ ( subquery) ))
which works in 0.4.1, but not in 0.3.11
Thanks for the help!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment