Re: [sqlalchemy] 0.7 event migration

2011-12-26 Thread Kent

Documentation for AttributeImpl.callable_ still reads
optional function which generates a callable based on a parent
  instance, which produces the default values for a scalar or
  collection attribute when it's first accessed, if not present
  already.
But it seems it is no longer the function which generates a callable, 
but rather /is /the callable itself now, accepting both the state and 
the passive parameters.


It used to be two stages, first callable_ accepts a state and then that 
returns a callable which accepted the passive parameter.


Can you briefly summarize how this is meant to work now? (I think the 
doc string is wrong now??)


On 12/25/2011 10:31 AM, Michael Bayer wrote:

yes a few change names, reconstruct_instance, init_instance, init_failed.

On Dec 24, 2011, at 7:42 PM, Kent Bower wrote:


Right.  And reconstruct_instance() was renamed load()?

On 12/24/2011 5:56 PM, Michael Bayer wrote:

On Dec 24, 2011, at 10:04 AM, Kent wrote:


As the migration guide suggests, I'd like to embrace the events API.
Is mapper event load() invoked at exactly the same place as the
deprecated reconstruct_instance() ?

yeah nothing has been moved.   All the places where the internals would call 
XXXExtension.xxx_event() were just replaced with self.dispatch.xxx_event(), and 
the old Extension classes are invoked via an adapter to the new system.   All 
unit tests for the extension system remain in place and haven't been modified.




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


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



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



Re: [sqlalchemy] 0.7 event migration

2011-12-26 Thread Michael Bayer

On Dec 26, 2011, at 9:07 AM, Kent wrote:

 Documentation for AttributeImpl.callable_ still reads 
 optional function which generates a callable based on a parent
   instance, which produces the default values for a scalar or
   collection attribute when it's first accessed, if not present
   already.
 But it seems it is no longer the function which generates a callable, but 
 rather is the callable itself now, accepting both the state and the passive 
 parameters.
 
 It used to be two stages, first callable_ accepts a state and then that 
 returns a callable which accepted the passive parameter.  

yes that was a fabulous simplification of things I'm still very happy about.


 
 Can you briefly summarize how this is meant to work now? (I think the doc 
 string is wrong now??)

docstring is wrong yes.   the callable just receives a state and a passive 
flag, then loads something for the attribute.It's just one less level of 
callable and the two that we have in use are LoadDeferredColumns and 
LoadLazyAttribute in strategies.py. This also isn't very public API and if 
I pointed you to this for some previous issue, I'd be curious if I remembered 
to mention that.



 
 On 12/25/2011 10:31 AM, Michael Bayer wrote:
 
 yes a few change names, reconstruct_instance, init_instance, init_failed.
 
 On Dec 24, 2011, at 7:42 PM, Kent Bower wrote:
 
 Right.  And reconstruct_instance() was renamed load()?
 
 On 12/24/2011 5:56 PM, Michael Bayer wrote:
 On Dec 24, 2011, at 10:04 AM, Kent wrote:
 
 As the migration guide suggests, I'd like to embrace the events API.
 Is mapper event load() invoked at exactly the same place as the
 deprecated reconstruct_instance() ?
 yeah nothing has been moved.   All the places where the internals would 
 call XXXExtension.xxx_event() were just replaced with 
 self.dispatch.xxx_event(), and the old Extension classes are invoked via 
 an adapter to the new system.   All unit tests for the extension system 
 remain in place and haven't been modified.
 
 
 
 -- 
 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.
 
 -- 
 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.
 
 
 
 -- 
 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.

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



Re: [sqlalchemy] 0.7 event migration

2011-12-25 Thread Michael Bayer
yes a few change names, reconstruct_instance, init_instance, init_failed.

On Dec 24, 2011, at 7:42 PM, Kent Bower wrote:

 Right.  And reconstruct_instance() was renamed load()?
 
 On 12/24/2011 5:56 PM, Michael Bayer wrote:
 On Dec 24, 2011, at 10:04 AM, Kent wrote:
 
 As the migration guide suggests, I'd like to embrace the events API.
 Is mapper event load() invoked at exactly the same place as the
 deprecated reconstruct_instance() ?
 yeah nothing has been moved.   All the places where the internals would call 
 XXXExtension.xxx_event() were just replaced with self.dispatch.xxx_event(), 
 and the old Extension classes are invoked via an adapter to the new system.  
  All unit tests for the extension system remain in place and haven't been 
 modified.
 
 
 
 -- 
 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.
 
 
 -- 
 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.
 

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



[sqlalchemy] 0.7 event migration

2011-12-24 Thread Kent
As the migration guide suggests, I'd like to embrace the events API.
Is mapper event load() invoked at exactly the same place as the
deprecated reconstruct_instance() ?

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



Re: [sqlalchemy] 0.7 event migration

2011-12-24 Thread Michael Bayer

On Dec 24, 2011, at 10:04 AM, Kent wrote:

 As the migration guide suggests, I'd like to embrace the events API.
 Is mapper event load() invoked at exactly the same place as the
 deprecated reconstruct_instance() ?

yeah nothing has been moved.   All the places where the internals would call 
XXXExtension.xxx_event() were just replaced with self.dispatch.xxx_event(), and 
the old Extension classes are invoked via an adapter to the new system.   All 
unit tests for the extension system remain in place and haven't been modified.



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

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



Re: [sqlalchemy] 0.7 event migration

2011-12-24 Thread Kent Bower

Right.  And reconstruct_instance() was renamed load()?

On 12/24/2011 5:56 PM, Michael Bayer wrote:

On Dec 24, 2011, at 10:04 AM, Kent wrote:


As the migration guide suggests, I'd like to embrace the events API.
Is mapper event load() invoked at exactly the same place as the
deprecated reconstruct_instance() ?

yeah nothing has been moved.   All the places where the internals would call 
XXXExtension.xxx_event() were just replaced with self.dispatch.xxx_event(), and 
the old Extension classes are invoked via an adapter to the new system.   All 
unit tests for the extension system remain in place and haven't been modified.




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



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