[sqlalchemy] Re: sqlalchemy and desktop apps

2010-07-24 Thread avdd
Hi Joel, Although my application is deployed on the web it was written with the goal of being redeployable as a desktop app, and to this end I have been able to abstract away the web details so that I can code my application very similarly to a desktop app. The relevance here is that all

[sqlalchemy] optimistic concurrency and relationships

2010-07-24 Thread avdd
I rely heavily on the version_id_col feature and I would like to be able to either explicitly increment the version, or have the version incremented when a relationship changes. The issue here is that a change in a relationship is a semantic change to the parent record and should conflict with

Re: [sqlalchemy] sqlalchemy and desktop apps

2010-07-24 Thread Tamás Bajusz
Hi Joel! pypapi.org is the bigest example a know. It's using pyqt4, sqlalchemy and zope interfaces/schema/etc. The only drawback for me, the code using too much italiano :) Regards, gbtami On Sat, Jul 24, 2010 at 3:21 AM, Joel Mohler goo...@kiwistrawberry.us wrote: Hello, I'm a happy user of

[sqlalchemy] session get last row id?

2010-07-24 Thread manman
table A,B B.a_id=A.id my code like this: new_a=A() session.begin() session.add(new_a) new_b=B() new_b.a_id=new_a.id session.add(new_b) try: session.commit() except: session.rollback() raise why new_b.a_id is None? how to do? -- You received this message because you are subscribed to

Re: [sqlalchemy] session get last row id?

2010-07-24 Thread Lance Edgar
On 7/24/2010 8:21 AM, manman wrote: table A,B B.a_id=A.id my code like this: new_a=A() session.begin() session.add(new_a) new_b=B() new_b.a_id=new_a.id session.add(new_b) try: session.commit() except: session.rollback() raise why new_b.a_id is None? how to do? I presume a.id

Re: [sqlalchemy] optimistic concurrency and relationships

2010-07-24 Thread Michael Bayer
On Jul 24, 2010, at 2:33 AM, avdd wrote: I rely heavily on the version_id_col feature and I would like to be able to either explicitly increment the version, or have the version incremented when a relationship changes. The issue here is that a change in a relationship is a semantic change

[sqlalchemy] Re: sqlalchemy and desktop apps

2010-07-24 Thread Joel Mohler
gbtami, Thanks! pypapi.org is the bigest example a know. It's using pyqt4, sqlalchemy and zope interfaces/schema/etc. The only drawback for me, the code using too much italiano :) Indeed, too Italiano for me too, but the picture at http://www.pypapi.org/chrome/site/pypapi.gif is worth a 1000

[sqlalchemy] Re: session get last row id?

2010-07-24 Thread manman
thanks. if not use relation then how to do? i hate use ForeignKey or ManyToMany. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to

Re: [sqlalchemy] Re: session get last row id?

2010-07-24 Thread Lance Edgar
On Sat, 2010-07-24 at 07:06 -0700, manman wrote: thanks. if not use relation then how to do? i hate use ForeignKey or ManyToMany. So did the explicit call to session.flush() not work? Here it is again for reference: new_a = A() session.begin() session.add(new_a) session.flush()

[sqlalchemy] Re: session get last row id?

2010-07-24 Thread manman
if use flush() then how to rollback ? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more

Re: [sqlalchemy] Re: session get last row id?

2010-07-24 Thread Alexandre Conrad
flush is not commit. After a flush, you can still rollback. 2010/7/24 manman ne.man...@gmail.com if use flush() then how to rollback ? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] Re: session get last row id?

2010-07-24 Thread manman
new_a=A() session.begin() session.add(new_a) session.flush() new_b=B() new_b.a_id=new_a.id session.add(new_b) try: session.commit() except: session.rollback() raise this code is right? when error all be rollback? -- You received this message because you are subscribed to the Google

Re: [sqlalchemy] Re: session get last row id?

2010-07-24 Thread Lance Edgar
On Sat, 2010-07-24 at 08:06 -0700, manman wrote: new_a=A() session.begin() session.add(new_a) session.flush() new_b=B() new_b.a_id=new_a.id session.add(new_b) try: session.commit() except: session.rollback() raise this code is right? when error all be rollback? Should

[sqlalchemy] Problems with synonym property using a mixin class

2010-07-24 Thread Nikolaj
I'm having trouble inheriting a synonym property from a mixin class. It obviously works if the call to synonym() is on the child class and just the get/set methods are left on the mixin. Here is an example: from sqlalchemy import create_engine, Column, ForeignKey from sqlalchemy.ext.declarative

[sqlalchemy] Cascading delete down through in directed graph

2010-07-24 Thread troutwine
Hello all, I've made some modifications to the directed graph[1] example, of primary interest to this email being the introduction Manufacturer objects which act as owners of Nodes. My desire is to cascade the deletion of a Manufacturer down to every Node and Edge, even if the side of one Edge is

Re: [sqlalchemy] Problems with synonym property using a mixin class

2010-07-24 Thread Michael Bayer
On Jul 24, 2010, at 5:40 PM, Nikolaj wrote: I'm having trouble inheriting a synonym property from a mixin class. It obviously works if the call to synonym() is on the child class and just the get/set methods are left on the mixin. Here is an example: from sqlalchemy import create_engine,