[sqlalchemy] Re: prevent premature object flushing

2007-09-01 Thread Haseeb
You're right - I am using Session.mapper which I took off the pylons tutorials. I'm mainly using Session.mapper to get the old assignmapper functionality of the 0.3x tree. Is there a way to get assignmapper functionality in 0.4x without losing the ability to control when an object gets added to th

[sqlalchemy] SQLAlchemy 0.4 beta5 released

2007-09-01 Thread Michael Bayer
Codename for SQLAlchemy 0.4 beta5: "Better than beta4." Beta4 introduced a small connection pool glitch which we fixed within a few revisions of that release (yes its the "too many connections" issue you're all getting), so its recommended everyone on beta4 upgrade to beta5 (unless of cour

[sqlalchemy] Re: Self Referencing through Association?

2007-09-01 Thread Michael Bayer
for an association pattern, you need to construct an explicit class with its own mapper to handle the association..in this case it would be something like mapper(NodeAssociation, node_association_table). The "primaryjoin" option is only meant to deal with the direct parent and child table

[sqlalchemy] Re: prevent premature object flushing

2007-09-01 Thread Michael Bayer
you probably dont want to save() the object to the session until its in a decent state. Note that the usage of Session.mapper, which is going to "autosave" new objects to the session, is not recommended, since you cant control when an object gets saved. I'm pretty sure this has been take

[sqlalchemy] prevent premature object flushing

2007-09-01 Thread Haseeb
I'm using 0.4b4's scoped_session + sessionmaker with autoflush=True. Is there a way to prevent autoflushing an object when a query is run on an unrelated table? I have a partially constructed object and I need to execute queries on other tables to populate certain fields on the object. These queri

[sqlalchemy] Self Referencing through Association?

2007-09-01 Thread Aaron R
Hello, I am trying to create a self reference so that a Node has children and parents but the information is stored in an association parent so that a Node can have more than one parent. http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_relation_selfreferential Tables like this: nod

[sqlalchemy] Re: Strange Behavior (0.4b4)

2007-09-01 Thread Michael Bayer
Hi David - "version_id_col" needs to point to an actual Column instance, not a string. - mike On Sep 1, 2007, at 12:39 PM, Nachtrabe wrote: > > Let me prefix this by saying that I am a newbie to SA, though not to > ORMs in general. So far I've really enjoyed using SA: its an amazing > pa

[sqlalchemy] Strange Behavior (0.4b4)

2007-09-01 Thread Nachtrabe
Let me prefix this by saying that I am a newbie to SA, though not to ORMs in general. So far I've really enjoyed using SA: its an amazing package for working with databases. Presently I am trying to create a GM tool for Shadowrun 4th Edition, where I am trying to model this concept called a "Dat

[sqlalchemy] Re: advice on modifying uniqueobject recipe

2007-09-01 Thread sdobrev
> When I create an instance using pet('Jack', 'dog'), I get the > following error: > > __call__() takes exactly 1 argument (3 given) > > If I change it to pet(name='Jack', species='dog'), it works just > fine. > > Orest u need to have these: def __call__( self, **kwargs) hashkey=tuple( kwa