I have a view in an FB db with basically does this

CREATE VIEW VCBOOK(
    CB_CELLARBOOKID,
    CBV_CBVINTAGEID,
    CBB_CBBOTTLEID
)
AS
select cb.cellarbookid, cbv.cbvintageid, cbb.cbbottleid,
from cellarbook cb
left outer join cbvintage cbv on cb.cellarbookid = cbv.fk_cellarbookid
left outer join cbbottle cbb on cbv.cbvintageid = cbb.fk_cbvintageid

The actual view has many more columns but I think the above is enough to 
show what I would like to accomplish.

In the application I then use it e.g. like this:
query(db.Vcbook).all()

Now as the cbv_cbvintageid and cbb_cbbottleid can be Null I get "None" back.

I thought lets get rid of this view and just use joins, but I can not 
figure it out.

Doing this:
wine = session.query(db.Cellarbook).outerjoin([db.Cbvintage, 
db.Cbbottle]).all()

Only gives me 5 rows, i.e. only the one from db.Cellarbook.

Can anyone push me in the right direction on this?

Werner
P.S.
I am on 0.5rc1

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to