[Zope-Coders] Re: [CMF-checkins] CVS: CMF/CMFStaging CMF/CMFStaging - Imported sources

Shane Hathaway shane@zope.com
Thu, 16 May 2002 12:56:00 -0400


Florent Guillaume wrote:
> Brian Lloyd <brian@zope.com> wrote:
> 
>>...you'll see a getVersionOfResource call (that is implemented by
>>the Repository). You could pretty easily implement a traversal
>>hook to get directly addressable versions. A quick, untested
>>example:
> 
> 
> Ok thanks a lot. I hadn't looked deep enough at that part.
> Thanks for the sample code too.
> 
> Very interesting indeed ;-)

One caution: getVersionOfResource() currently makes a copy in the 
database every time you call it (so you can't accidentally change the 
object that's actually stored in the repository).  So this traversal 
hook would be pretty expensive.  I'm sure there's a way we can solve 
this, and getVersionOfResource() is the right call to use, but before 
putting anything into production you should keep this in mind.

Shane