[sqlalchemy] Re: post-populate extension (2)

2008-03-26 Thread Rick Morrison
Also be aware that the API to populate_instance() has changed (ironically, the very thing that I was worrying about in the thread) Update this: def populate_instance(self, mapper, selectcontext, row, instance, identitykey, isnew): if isnew:

[sqlalchemy] Re: post-populate extension (2)

2008-03-25 Thread Michael Bayer
we have a new hook that will be coming soon called something like __reconstitute__(), which will be called on instances after they've been created and had their initial population from the result row. Note that eagerly-loaded collections might not be fully loaded at this stage. at the

[sqlalchemy] Re: post-populate extension

2007-01-25 Thread Rick Morrison
Ya, the post_populate hook w/b great -- getting the callback to work was kinda tricky, and I'm worried calling back to internals like that. Calling signatures often change on internals. On 1/25/07, Michael Bayer [EMAIL PROTECTED] wrote: yup that would be how you can do that right now. i

[sqlalchemy] Re: post-populate extension

2007-01-25 Thread Michael Bayer
ok show me how youre doing it and ill see if i should make something more solid for that. On Jan 25, 2007, at 11:52 AM, Rick Morrison wrote: Ya, the post_populate hook w/b great -- getting the callback to work was kinda tricky, and I'm worried calling back to internals like that. Calling

[sqlalchemy] Re: post-populate extension

2007-01-25 Thread Rick Morrison
K, here's a snipppet that shows the populate_instance catch. It's pretty straightforward, but the way that the hook takes (row, instance) in that order, while the callback to the mapper takes (instance, row) got me thinking about calling back to internals and API stability. def