[sqlalchemy] Re: cookbooks

2009-08-31 Thread darkblueB
ooohhh no select_from() at all simple - thxs On Aug 31, 1:24 pm, "Michael Bayer" wrote: > darkblueB wrote: > > > select k.name, c.description from keyword k > > JOIN cookbook_keyword on (k.id = keyword_id) > > JOIN cookbook c on(c.id = cookbook_id) >

[sqlalchemy] Re: cookbooks

2009-08-31 Thread darkblueB
select k.name, c.description from keyword k JOIN cookbook_keyword on (k.id = keyword_id) JOIN cookbook c on(c.id = cookbook_id) is one example, I believe On Aug 31, 7:51 am, "Michael Bayer" wrote: > darkblueB wrote: > > > well, these all do *something*  but I am a littl

[sqlalchemy] Re: cookbooks

2009-08-30 Thread darkblueB
,Keyword,Cookbook.keywords)).all() ## ibid Session.query(Cookbook,Keyword).select_from( join (Cookbook,Keyword,Cookbook.keywords)).all() ## selects cookbook id, description, and keyword id, name On Aug 30, 5:02 pm, darkblueB wrote: > so I am working through the cookbook many-to-many ORM exam

[sqlalchemy] Re: cookbooks

2009-08-30 Thread darkblueB
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 wrote: > On Aug 30, 2009, at 8:02 PM, darkblueB wrote: > > > > > Sessi

[sqlalchemy] cookbooks

2009-08-30 Thread darkblueB
so I am working through the cookbook many-to-many ORM example on zzzeek's blog. after executing, Base.metadata.tables looks like this: { 'cookbook': Table('cookbook', MetaData(None), Column('id', Integer(), table=, primary_key=True, nullable=False), Column('description', Text(le

[sqlalchemy] three way joins and a filter?

2009-08-29 Thread darkblueB
first attempt, not quite there I am using ORM classes with declarative base, and meta.reflact() >>> print join(SAPFEvent,SAEvent) bt_pfevents JOIN bt_cevents ON bt_cevents."key" = bt_pfevents.event_key >>> print join(SAInsResp,SAPFEvent) bt_insurance_responses JOIN bt_pfevents ON bt_pfevents."ke

[sqlalchemy] Re: new questions

2009-08-21 Thread darkblueB
On Aug 21, 2:17 am, "King Simon-NFHD78" wrote: > darkblueB wrote: > > > ok, I have done this > > I have an object def and a __table__ for all of the "main actors" in > > my setup > > I defined an __init__() for one of them > > I use the d

[sqlalchemy] Re: new questions

2009-08-21 Thread darkblueB
On Aug 19, 2:27 am, "King Simon-NFHD78" wrote: > > -Original Message- > > From: sqlalchemy@googlegroups.com > > [mailto:sqlalch...@googlegroups.com] On Behalf Of darkblueB > > Sent: 19 August 2009 02:58 > > To: sqlalchemy > > Subject:

[sqlalchemy] Re: new questions

2009-08-18 Thread darkblueB
On Aug 17, 5:40 am, "King Simon-NFHD78" wrote: > > -Original Message- > > From: sqlalchemy@googlegroups.com > > [mailto:sqlalch...@googlegroups.com] On Behalf Of darkblueB > > Sent: 17 August 2009 06:31 > > To: sqlalchemy > > Subject: [sq

[sqlalchemy] new questions

2009-08-16 Thread darkblueB
Hi- I have just read a lot and gone through some exercises, but am at an early stage here.. Two questions: 1) I have an existing database, and want to use sa to work with it.. so "reflect" seems like what I want. I have loaded up the database successfully - sqlite - not with reflect(), but inst