Re: [sqlalchemy] Re: backref/back_populates question

2011-08-14 Thread Michael Bayer
On Aug 15, 2011, at 12:46 AM, cd34 wrote: > On Aug 14, 11:39 pm, Michael Bayer wrote: >>> receive the ExtendedProfile class declarations. >> >> Well those are two different classes, so first you'd need to assign a >> relationship() to AuthUser that references ExtendedProfile. If you're >> lo

[sqlalchemy] Re: backref/back_populates question

2011-08-14 Thread cd34
On Aug 14, 11:39 pm, Michael Bayer wrote: > > receive the ExtendedProfile class declarations. > > Well those are two different classes, so first you'd need to assign a > relationship() to AuthUser that references ExtendedProfile.  If you're > looking for "backref" to do this via ExtendedProfile

Re: [sqlalchemy] backref/back_populates question

2011-08-14 Thread Michael Bayer
On Aug 14, 2011, at 3:41 PM, cd34 wrote: > > In the code, what I'm trying to accomplish is query against AuthUser, > but, have ExtendedProfile's fields available to that query. It seemed > like back_populate should do that, but, it says (correctly) that the > AuthUser doesn't point to a mapper

[sqlalchemy] backref/back_populates question

2011-08-14 Thread cd34
I'm writing a package for Pyramid which has a base AuthUser declaration. I want to allow users that have installed the package the ability to extend the AuthUserProfile so that the Mako templates can be accessed with my subscriber which populates user. with the AuthUser properties. Currently, it d

Re: [sqlalchemy] Instance is not persistent within this Session

2011-08-14 Thread Michael Bayer
thanks for the clarification. there's nothing I can see in your practices here that causes that error, it has to do with how you're getting at Session objects in relation to your wx environment. I'd add assertions at every point to ensure that the Session you're getting is the one that you t

Re: [sqlalchemy] Instance is not persistent within this Session

2011-08-14 Thread werner
Hi Michael, One thing that stands out here is the usage of "self.", implying the scope at which the various objects are declared is all the same. Engine, a connection, sessionmaker, session, then actual objects, etc. all at the exact same scope on "self", and what's "self"?Scope is the im

Re: [sqlalchemy] Instance is not persistent within this Session

2011-08-14 Thread Michael Bayer
One thing that stands out here is the usage of "self.", implying the scope at which the various objects are declared is all the same. Engine, a connection, sessionmaker, session, then actual objects, etc. all at the exact same scope on "self", and what's "self"?Scope is the important thing

[sqlalchemy] Instance is not persistent within this Session

2011-08-14 Thread werner
A few of my user run into this exception when they use a dialog to create a new wine purchase. Fri Aug 05 10:24:56 2011 Version: 3.2.182.9 wxV: 2.8.11.0 (msw-unicode) * Traceback (most recent call last): File "dialognewwine.pyo", line 779, in OnSaveButton File "dialognewwi