Dear sqlalchemy developers,

the `create_instance` event has been deprecated with version 0.9 
(http://docs.sqlalchemy.org/en/rel_0_9/orm/events.html?highlight=create_instance#sqlalchemy.orm.events.MapperEvents.create_instance).
 
The deprecation message stated that it will not be necessary any more, 
because its behavior can be realized if necessary by using the `load` event 
of the instance (the message is removed by now).

Unfortunately, this is not true entirely, and I strongly opt for reviving 
such an event. In the scenario where a class's `__new__` method is using 
database information to create a complex instance, it might be necessary to 
provide information to it. Even when using a custom class manager by using 
a `sqlalchemy.ext.instrumentation` extension, only its `new_instance` 
method is called without access to the current row, which is very 
unfortunate (the call is coming from `sqlalchemy.loading._instance`, which 
can not be easily replaced). This is critical in some cases, e.g., as I'm 
writing a db-backed numpy array class, where there IS complex stuff going 
on in __new__ which I can't take care of right now.

Is there another way to provide row information to the `__new__` method 
that I didn't see? If not, what is the cleanest way to address this? The 
`create_instance` event seems to have been just what I need, but it's 
unfortunately not there anymore. :(

Best,
Christoph

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to