[sqlalchemy] Re: Versioning

2008-09-12 Thread Diez B. Roggisch
Sam schrieb: One of the things I really liked about sqlobject was its versioning plug-in. ( http://www.sqlobject.org/Versioning.html ) Is there anything similar for sqlalchemy? A google search turned up versioned ( http://elixir.ematia.de/apidocs/elixir.ext.versioned.html ) This is a

[sqlalchemy] ProgrammingError invalidates Session

2008-09-12 Thread Diez B. Roggisch
Hi, I've got a table with a unique-constraint. And I've got an automatic transaction management via decorator in place. Now it can happen that the violation of that constraint occurs - then a ProgrammingError is raised. As the violation is non-fatal, I try to catch it, and continue. The

[sqlalchemy] Re: Adjacency List + Alternate Join Conditions == ???

2008-09-12 Thread GustaV
The main reason why I wan't to use relations is eagerloading, because it is the only way, as far as I can see, to retrieve data from DB from several objects in one request. I don't wan't each of my 50 objects requests the DB to fill its own neighbors; but fill them all in one request.

[sqlalchemy] Re: Versioning

2008-09-12 Thread az
On Friday 12 September 2008 05:37:35 Sam wrote: One of the things I really liked about sqlobject was its versioning plug-in. ( http://www.sqlobject.org/Versioning.html ) Is there anything similar for sqlalchemy? A google search turned up versioned (

[sqlalchemy] Re: Versioning

2008-09-12 Thread Gaetan de Menten
On Fri, Sep 12, 2008 at 4:37 AM, Sam [EMAIL PROTECTED] wrote: One of the things I really liked about sqlobject was its versioning plug-in. ( http://www.sqlobject.org/Versioning.html ) Is there anything similar for sqlalchemy? A google search turned up versioned (

[sqlalchemy] Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
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

[sqlalchemy] Re: ProgrammingError and Catching an Exception

2008-09-12 Thread Eoghan Murray
As the session is handled by TurboGears, I tried the following: from turbogears.database import session try: MyDBLog( myfield='A too long string ' ) session.commit() session.begin() except Exception, e: log.error(Exception occurred with database logging:

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
Still not there, but another question/problem below: Werner F. Bruhin wrote: 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

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
Werner F. Bruhin wrote: ... j3 = sao.outerjoin(db.Cellarbook, db.Cbvintage).outerjoin(db.Cbvintage, db.Cbbottle) print j3 j1 and j2 produce a join clause, but on j3 I get the following exception: I different exception if I actually try to use j3: I do this: wine =

[sqlalchemy] Re: ProgrammingError invalidates Session

2008-09-12 Thread Michael Bayer
On Sep 12, 2008, at 3:48 AM, Diez B. Roggisch wrote: Hi, I've got a table with a unique-constraint. And I've got an automatic transaction management via decorator in place. Now it can happen that the violation of that constraint occurs - then a ProgrammingError is raised. As the

[sqlalchemy] Re: any effort getting sqlalchemy to work on ironpython is going on ?

2008-09-12 Thread Michael Bayer
On Sep 11, 2008, at 11:01 PM, sakesun wrote: I need sqlalchemy to work on ironpython (1.2 or 2.0b) sqlalchemy fail on ironpython even with simple use case like create simple Table definition. from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey metadata =

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Michael Bayer
On Sep 12, 2008, at 9:42 AM, Werner F. Bruhin wrote: j1 = sao.outerjoin(db.Cellarbook, db.Cbvintage) print j1 j2 = sao.outerjoin(db.Cbvintage, db.Cbbottle) print j2 j3 = sao.outerjoin(db.Cellarbook, db.Cbvintage).outerjoin(db.Cbvintage, db.Cbbottle) print j3 j1 and j2 produce a

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
Michael, Michael Bayer wrote: ... if CellarBook, Cbvintage, etc. are mapped classes, the join and outerjoin functions you must be using are from sqlalchemy.orm import join, outerjoin. those are aware of ORM mapped classes whereas sqlalchemy.sql.expression.join/outerjoin are not.

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Michael Bayer
On Sep 12, 2008, at 11:43 AM, Werner F. Bruhin wrote: Michael, Michael Bayer wrote: ... if CellarBook, Cbvintage, etc. are mapped classes, the join and outerjoin functions you must be using are from sqlalchemy.orm import join, outerjoin. those are aware of ORM mapped classes whereas

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
Michael Bayer wrote: ... Now, if you actually want to get back objects for the outerjoins, youd say somehting like: sess.query(SomeClass, SomeOtherClass, SomeThirdClass) On Firebird when I do this I get a cross join (according to the Helen Borrie book) which in my case gives me 280

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Michael Bayer
On Sep 12, 2008, at 12:49 PM, Werner F. Bruhin wrote: Michael Bayer wrote: ... Now, if you actually want to get back objects for the outerjoins, youd say somehting like: sess.query(SomeClass, SomeOtherClass, SomeThirdClass) On Firebird when I do this I get a cross join (according to

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
Michael Bayer wrote: On Sep 12, 2008, at 12:49 PM, Werner F. Bruhin wrote: Michael Bayer wrote: ... Now, if you actually want to get back objects for the outerjoins, youd say somehting like: sess.query(SomeClass, SomeOtherClass, SomeThirdClass) On Firebird when I do

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Michael Bayer
On Sep 12, 2008, at 1:09 PM, Werner F. Bruhin wrote: Michael Bayer wrote: On Sep 12, 2008, at 12:49 PM, Werner F. Bruhin wrote: Michael Bayer wrote: ... Now, if you actually want to get back objects for the outerjoins, youd say somehting like: sess.query(SomeClass, SomeOtherClass,

[sqlalchemy] Re: Replacing a Firebird view with orm.query.join

2008-09-12 Thread Werner F. Bruhin
Michael, Michael Bayer wrote: ... OK, more specifically, this is how to do the query: sess.query(SomeClass, SomeOtherClass, SomeThirdClass).outerjoin((SomeOtherClass, SomeClass.foo==SomeOtherClass.bar), (SomeThirdClass, SomeOtherClass.foo==SomeThirdClass.bar)) if firebird can't do

[sqlalchemy] Re: any effort getting sqlalchemy to work on ironpython is going on ?

2008-09-12 Thread Kyle Schaffrick
On Fri, 12 Sep 2008 11:11:50 -0400 Michael Bayer [EMAIL PROTECTED] wrote: On Sep 11, 2008, at 11:01 PM, sakesun wrote: I need sqlalchemy to work on ironpython (1.2 or 2.0b) sqlalchemy fail on ironpython even with simple use case like create simple Table definition. from