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.


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).

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 ?


I'll give the ClassManager a try now.  Hope you can make some sense of my code.

Enjoy your evening,
Chris

--~--~---------~--~----~------------~-------~--~----~
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