Hi!

I have 2 relations:     
 - recipes-categories (M:N)
 - recipes-flags (M:N)

I'd like to get something like:
SELECT recipes.title FROM recipes
  JOIN _recipes_ctgs_recipes
    ON _recipes_ctgs_recipes.id_recipe = recipes.id
    JOIN recipes_ctgs
      ON _recipes_ctgs_recipes.id_recipes_ctg=recipes_ctgs.id
  JOIN _recipes_flgs_recipes
    ON _recipes_flgs_recipes.id_recipe = recipes.id
    JOIN recipes_flgs
      ON _recipes_flgs_recipes.id_recipes_flg=recipes_flgs.id
  WHERE recipes_ctgs.title='cat1' AND recipes_flgs.title='flag1'

when I run
sess.query(Recipe).join("ctgs").join("flgs").select(...)
it fails with

sqlalchemy.exceptions.SQLError: (ProgrammingError) table name
"_recipes_ctgs_recipes" specified more than once

where "_recipes_ctgs_recipes" is a secondary table. Full example attached.

SA 0.3.7, PostgreSQL 8.1

David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: test.tgz
Description: GNU Unix tar archive

Reply via email to