On Sep 24, 2007, at 10:43 PM, Huy Do wrote:

>
> Michael Bayer wrote:
>> On Sep 24, 2007, at 11:48 AM, Huy Do wrote:
>>
>>
>>> Hi,
>>>
>>> Is it possible to get SA ORM to return plain python objects (with
>>> eagerloaded relations and all) but without any attribute
>>> instrumentation
>>> (or anything else magically added by SA).
>>>
>>>
>>
>>
>> not really.   unless you remove the instrumentation from the classes
>> themselves afterwards (a one way operation).
>>
> Any pointers on how to do this ? to the whole object hierachy.

clear_mappers()

>> of course you could argue that theres no technical reason the ORM
>> shouldnt be able to do this.  there could be some extremely
>> specialized rewrite of attributes.py that could do it perhaps, but
>> maintaining test coverage for that would be a whole project in itself
> Would a mapper extension allow me to do this ?

not really.

>
> I think this would be a great feature to have because there are  
> many use
> cases in my application (mainly displaying/processing tables) where I
> don't want/need the overhead of the instrumentation (and it really  
> does
> add quite a bit), but would still love the excellent mapping abilities
> (i.e have fully hydrated domain objects rather then ResultProxy).

I think theres still going to be a lot of overhead even without  
instrumentation.  anyway, this would be an enormous amount of effort  
to establish and also to keep test coverage going, and would probably  
be a significant complication to the internals.  Id rather focus on  
making our current, single approach faster and better (note that 0.4  
uses about half the method call overhead of 0.3 for load operations).

If you want, just create a rudimentary object creation layer over the  
normal SQL constructs.  It would be more appropriate for this to be  
something entirely separate from the existing orm module.


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to