[Sqlalchemy-users] Extra Insert Mapper Problems

2006-09-29 Thread Hogarty, David A.
I’m trying to represent a graph with nodes and edges… For the nodes I’m using polymorphic single-table inheritance. The relevant mapping & code is:   # Mapper classes: # # Project # # Node #   -> Algorithm #   -> Parameter # # Edge   # Project.nodes -> Node (->N) #

Re: [Sqlalchemy-users] Dependency error: nodes and edges

2006-09-26 Thread Hogarty, David A.
Thanks Michael, I am trying to build up the complexity one piece at a time, and you've already answered several issues up to this point. Like you said in the earlier email, this is an atypical mapping and I'm impressed to date with how well SA has been handling it. I'll try to find ways of m

[Sqlalchemy-users] Dependency error: nodes and edges

2006-09-26 Thread Hogarty, David A.
I'm getting a strange error when flushing the session after the following sequence of creations:       def test_nodes(self):    algs = [Algorithm(name='a'+str(num)) for num in range(0,7)]1) params = [Parameter(name='p'+str(num)) for num in range(0,20)]    for a in algs:  

[Sqlalchemy-users] AttributeError on polymorphic single-table inheritance

2006-09-22 Thread Hogarty, David A.
I've been spending the past few hours trying to understand/debug a problem I'm having with my single-table inheritance mapping. I am attaching the code for a test case that results in an attribute error. The relevant pieces (I think) are shown below. They result in an AttributeError in the sess

Re: [Sqlalchemy-users] Compound Keys: determining for create, using compound foreign keys

2006-09-21 Thread Hogarty, David A.
Title: Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions? Looking at the code, the problem seems to arise in sqlalchemy/orm/mapper.py, in the save_obj function   The basic structure is:   run before_insert/before_update for all objects   save all the mapper attributes to a table

[Sqlalchemy-users] Compound Keys: determining for create, using compound foreign keys

2006-09-21 Thread Hogarty, David A.
Title: Re: [Sqlalchemy-users] How ACID are SQLAlchemy transactions? I'm having a little difficulty figuring out how to work with compound primary keys within the following context: I have Projects, Versions, and for examples sake, 'Things' inside of both of these, as follows:   CREATE TABL