Re: [sqlalchemy] session.delete() when not single parent

2011-07-08 Thread Michael Bayer
On Jul 8, 2011, at 5:28 PM, Kent wrote: > Suppose I have a related collection that is *not* single_parent and > *not* cascade delete or delete_orphan. (The reasons are poor > relational schema design, which I can't control.) > > I would like to programatically delete records occasionally, but >

Re: [sqlalchemy] Problem with eagerload and lazy='joined'

2011-07-08 Thread Michael Bayer
On Jul 8, 2011, at 6:17 PM, Ben Chess wrote: > Hmm, bummer. > > We're pretty dependent on detached mode. We eagerload a bunch of > things for the purposes of storing them in memcache, and things don't > go well when they're not fully traversable. OK so you're caching.Actually when I work

Re: [sqlalchemy] Problem with eagerload and lazy='joined'

2011-07-08 Thread Ben Chess
Hmm, bummer. We're pretty dependent on detached mode. We eagerload a bunch of things for the purposes of storing them in memcache, and things don't go well when they're not fully traversable. I've been delving into the mapper.py code site you mention. It's a lot of new code to me, but I agree i

[sqlalchemy] session.delete() when not single parent

2011-07-08 Thread Kent
Suppose I have a related collection that is *not* single_parent and *not* cascade delete or delete_orphan. (The reasons are poor relational schema design, which I can't control.) I would like to programatically delete records occasionally, but session.delete(instance) throws "AssertionError: Depe

Re: [sqlalchemy] hybrid, relationships and inheritance.

2011-07-08 Thread Michael Bayer
On Jul 7, 2011, at 3:29 PM, James Studdart wrote: > Hi all, > I've got a question regarding hybrid properties and how to use them with > single table inheritance. > > I've got a class hierarchy like this (in semi-pseudo code): > > class MyBase(object): ># This has the tablename declared at

Re: [sqlalchemy] Problem with autocommit in SQL Server

2011-07-08 Thread Michael Bayer
On Jul 8, 2011, at 3:58 AM, Michael Kvyatkovskiy wrote: > Hello. > The task is to execute stored procedure which writes data to database > in SQL Server 2008 using SQLAlchemy 0.7.1 in Python 2.7.2. SQLAlchemy > uses pyodbc 2.1.8. When trying to use SQLAlchemy, data is not written > to database: >

[sqlalchemy] Problem with autocommit in SQL Server

2011-07-08 Thread Michael Kvyatkovskiy
Hello. The task is to execute stored procedure which writes data to database in SQL Server 2008 using SQLAlchemy 0.7.1 in Python 2.7.2. SQLAlchemy uses pyodbc 2.1.8. When trying to use SQLAlchemy, data is not written to database: from sqlalchemy.engine import create_engine from sqlalchemy.orm impo