Keyword.cookbooks ?? there is no Keyword.cookbooks defined in the example... I could imagine it, but its not there as is
Session.query(Keyword) is straightforward.. thats the same for any class "a specific Cookbook as parent".. I dont know about parents, or specific parents, yet I imagined that with the many-to-many defined, I could say "all cookbooks with this keyword" or "all keywords in this cookbook" but I dont get that yet... ??? On Aug 30, 5:26 pm, Michael Bayer <mike...@zzzcomputing.com> wrote: > On Aug 30, 2009, at 8:02 PM, darkblueB wrote: > > > > > Session.query(Cookbook.keywords).all() > > > but that generates only > > > Session.query(Cookbook.keywords).all() > > that is somewhat similar to a nonexistent feature which is considered > in ticket 1328, but that feature applies only to many-to-ones. If > you want a list of Keyword objects, you need to say Session.query > (Keyword). If you're looking to automatically create a join to the > parent, the most common way is to navigate along a backref (such as > "Keyword.cookbooks"). If you wanted to specify a specific Cookbook > as parent you can also use query.with_parent(some_cookbook, "keywords"). --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---