[sqlalchemy] Re: Use of new_instance() in the user-defined-state branch?

2008-03-28 Thread Phillip J. Eby
At 09:45 AM 3/28/2008 -0400, Michael Bayer wrote: On Mar 28, 2008, at 12:55 AM, Phillip J. Eby wrote: Sadly, about the only way for me to implement that without code duplication will be to temporarily change the item's __class__ to a subclass with an empty __init__ method. Unless there's

[sqlalchemy] Re: Use of new_instance() in the user-defined-state branch?

2008-03-28 Thread Phillip J. Eby
So you're still disagreeing with Jason, who's quite explicitly saying that SA's __init__ will blow up if it gets called. Which of you is right? :) At 11:38 AM 3/28/2008 -0400, Michael Bayer wrote: On Mar 28, 2008, at 10:58 AM, Phillip J. Eby wrote: Sorry, I should have included more

[sqlalchemy] Use of new_instance() in the user-defined-state branch?

2008-03-27 Thread Phillip J. Eby
I just noticed that in the latest version of the branch, there's a new_instance() call that is using a class' __new__ method in order to create a new instance, rather than using 'class()'. What I'd like to find out is how to get around this, because Trellis objects will not be properly

[sqlalchemy] Re: Use of new_instance() in the user-defined-state branch?

2008-03-27 Thread Phillip J. Eby
At 02:26 PM 3/27/2008 -0700, jason kirtland wrote: new_instance creates an instance without invoking __init__. The ORM uses it to recreate instances when loading from the database. new_instance can be added to InstrumentationManager as an extension method... The ORM doesn't care how

[sqlalchemy] Re: Integrating the ORM with Trellis

2008-03-04 Thread Phillip J. Eby
At 02:04 PM 3/3/2008 -0500, Michael Bayer wrote: the bug is that unregister_attribute() is not working, which the test suite is using to remove and re-register new instrumentation: class Foo(object): pass attributes.register_attribute(Foo, collection,

[sqlalchemy] Re: Integrating the ORM with Trellis

2008-03-03 Thread Phillip J. Eby
At 04:04 PM 2/27/2008 -0500, Michael Bayer wrote: do you have any interest in committing changes to the branch yourself ? as long as the unit tests keep running whatever you'd want is most likely fine with meotherwise I will at least experiment with doing away with __mro__ searching and