On Feb 7, 2009, at 8:27 PM, Christiaan Putter wrote:

>
> Hi Michael,
>
> Thanks for your swift reply.
>
> I wasn't really sure which way to go with combining Traits and SA.
> From reading through the source it seemed that I had to use
> InstrumentationManager, I think it said somewhere it was the stable
> public interface.  I had a look at the Trellis source as well, they
> subclass the ClassManager though.  I'll give that a try next.  Either
> way it's not quite clear from the source what I really need to
> implement in my own interface and how SA expects that to behave.

uh thats a little weird since the InstrumentationManager is designed  
to be the thing you subclass.  you're not supposed to subclass  
ClassManager.   There should be no difference in behavior subclassing  
one or the other.


> At the moment I think the problem lies with how attributes are get and
> set.  From what I understand from going through the SA source is that
> the mapper places decoraters on the attributes once Declarative has
> created the appropriate tables.  And Traits does something similar
> though I'm not quite sure how.  The entire process seems rather
> complex, complicated by the fact that Traits sometimes writes directly
> to the __dict__ of an instance without going through setattr first
> (which I'm guessing is what's needed by SA for its bookkeeping).

yeah thats all true but the point of InstrumentationManager is that  
its all OK - you send SQLA the events it needs.

> I'm quite sure that the SQL SA produces is correct, it's just the
> object's state that isn't being handled properly.  Is there some
> documentation somewhere that explains what the various methods in the
> interface (either InstrumentationManager or ClassManager) are supposed
> to do?  For instance is install_state(self, class_, instance, state)
> supposed to copy the data in the state parameter to the instance or
> merely store it for future use by state_getter ?

well thats all internal-ish API for which you'd have to just trace out  
the flow of data.    install_state() for example just sticks an  
InstanceState attributre on a given instance.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to