Re: [sqlalchemy] Re: SQLAlchemy Sessions

2010-03-29 Thread Daniel Robbins
On Sun, Mar 28, 2010 at 10:19 AM, Peteris Krumins peteris.krum...@gmail.com wrote: This is the best explanation I have read on this topic! Thanks for writing it! Now I clearly see what is going on. Just one more thing - when should remove() be called? (if at all) The model that works for me

[sqlalchemy] Restricting a delete based on a many-to-many mapping.

2010-03-29 Thread Rich
How is the best way to restrict a delete on an item if it has a value in a many-to-many mapping? For example: I have three tables: User, Group, and UserGroup. UserGroup is a many- to-many mapping table between User and Group. User has a relation called 'groups' and Group has a relation called

[sqlalchemy] PyODBCConnector dbapi question

2010-03-29 Thread Bo Shi
Hello, I had a custom dialect based on the PyODBC functionality that was working with SQLA SVN-6738. Upgrading to beta 3, my tests no longer pass, so I've begun the process updating - on_connect() was easy, now I'm stumped on connect(...). I've gotten to the point where, when using my dialect,

Re: [sqlalchemy] PyODBCConnector dbapi question

2010-03-29 Thread Michael Bayer
Bo Shi wrote: Hello, I had a custom dialect based on the PyODBC functionality that was working with SQLA SVN-6738. Upgrading to beta 3, my tests no longer pass, so I've begun the process updating - on_connect() was easy, now I'm stumped on connect(...). I've gotten to the point where, when

Re: [sqlalchemy] PyODBCConnector dbapi question

2010-03-29 Thread Bo Shi
Thanks, explicitly assigning self.dbapi in my dialect constructor seems to get around the exception. I do, however, encounter a new exception: File test_vertica.py, line 57, in testTransactionIsolation _, iso_level = e.execute('SHOW TRANSACTION_ISOLATION').fetchone() File

Re: [sqlalchemy] PyODBCConnector dbapi question

2010-03-29 Thread Bo Shi
Also, dunno if it's helpful or not, but this is a regression in 0.6beta3. My dialect plugin works as is when using 0.6beta2. On Mon, Mar 29, 2010 at 7:41 PM, Bo Shi bs1...@gmail.com wrote: Thanks, explicitly assigning self.dbapi in my dialect constructor seems to get around the exception. I

Re: [sqlalchemy] PyODBCConnector dbapi question

2010-03-29 Thread Michael Bayer
how come the strack trace shows beta2 as the version number in the path ? did you mean to say between beta1 and beta2 ? it looks specific to the C rewrite of RowProxy. basically the rows returned by fetchone(), fetchall() etc. are expected to be tuples. pep 249 specifies list of tuples

Re: [sqlalchemy] PyODBCConnector dbapi question

2010-03-29 Thread Bo Shi
how come the strack trace shows beta2 as the version number in the path ? Yeesh. My bad; I spoke too soon. As you had hypothesized, the error occurs only when I install using --with-cextensions (it doesn't have anything to do with beta2/3). Thanks, Bo On Mon, Mar 29, 2010 at 8:03 PM, Michael

Re: [sqlalchemy] Restricting a delete based on a many-to-many mapping.

2010-03-29 Thread Michael Bayer
On Mar 29, 2010, at 4:20 PM, Rich wrote: How is the best way to restrict a delete on an item if it has a value in a many-to-many mapping? For example: I have three tables: User, Group, and UserGroup. UserGroup is a many- to-many mapping table between User and Group. User has a