Re: [Zope] automagic reindexing of objects

2005-06-22 Thread Jürgen Herrmann
[ Jürgen Herrmann wrote:] ... > hook = object.get('_before_transaction_commit', None) > if hook: hook() ... of course it should be: getattr(object, '_before_transaction_commit', None) regards, juergen herrmann ___ >

Re: [Zope] automagic reindexing of objects

2005-06-22 Thread Florent Guillaume
Have a look at how CPS uses this hook to delay indexing to the end of the transaction. Code is at http://svn.nuxeo.org/trac/pub/file/CPSCore/trunk/ IndexationManager.py Then in all objects for which we want to delay indexing, we replace the reindexObject() method with: def reindexObj

Re: [Zope] automagic reindexing of objects

2005-06-22 Thread Jürgen Herrmann
hi all! as i had time to look at all the stuff, i realized, that i'm getting closer, but this is not exactly what i wanted... as i can see from the path, one has to call: beforeCommitHook(method, **args, **kwargs) on each transaction, correct? this is contrary to my idea of everything doing i

Re: [Zope] automagic reindexing of objects

2005-06-20 Thread Florent Guillaume
Dieter Maurer <[EMAIL PROTECTED]> wrote: > Jürgen Herrmann wrote at 2005-6-17 14:19 +0200: > >i make heavy use of indexes in my extension classes. these all inherit > >from catalogpathaware, so i have to call object.reindex_object() on > >each changed instance. calling it from attribute getters/se

Re: [Zope] automagic reindexing of objects

2005-06-20 Thread Jürgen Herrmann
[ Dieter Maurer wrote:] > Jürgen Herrmann wrote at 2005-6-17 14:19 +0200: >>i make heavy use of indexes in my extension classes. these all inherit >>from catalogpathaware, so i have to call object.reindex_object() on >>each changed instance. calling it from attribute getters/setters f.ex. >>is not

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Dieter Maurer
Jürgen Herrmann wrote at 2005-6-17 14:19 +0200: >i make heavy use of indexes in my extension classes. these all inherit >from catalogpathaware, so i have to call object.reindex_object() on >each changed instance. calling it from attribute getters/setters f.ex. >is not a good idea, because changing

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Paul Winkler
On Fri, Jun 17, 2005 at 02:19:26PM +0200, J?rgen Herrmann wrote: > hi all! > > i make heavy use of indexes in my extension classes. these all inherit > from catalogpathaware, so i have to call object.reindex_object() on > each changed instance. calling it from attribute getters/setters f.ex. > is

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Peter Bengtsson
On 6/17/05, Jürgen Herrmann <[EMAIL PROTECTED]> wrote: > > [ Peter Bengtsson wrote:] > > Personally I think one should stay the hell away from transactions. > > They're not for you to fiddle with. > > I understand your question and even though I think it's a bit crazy I > > can see a benefit (simp

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Jürgen Herrmann
[ Peter Bengtsson wrote:] > Personally I think one should stay the hell away from transactions. > They're not for you to fiddle with. > I understand your question and even though I think it's a bit crazy I > can see a benefit (simplicity for the programmer). > > How about a trickery solution like

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Peter Bengtsson
Personally I think one should stay the hell away from transactions. They're not for you to fiddle with. I understand your question and even though I think it's a bit crazy I can see a benefit (simplicity for the programmer). How about a trickery solution like this: class CatalogPathAware: def

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Jürgen Herrmann
[ Jonathan wrote:] > > - Original Message - > From: "Jürgen Herrmann" <[EMAIL PROTECTED]> >> i make heavy use of indexes in my extension classes. these all inherit >> from catalogpathaware, so i have to call object.reindex_object() on >> each changed instance. calling it from attribute get

Re: [Zope] automagic reindexing of objects

2005-06-17 Thread Jonathan
- Original Message - From: "Jürgen Herrmann" <[EMAIL PROTECTED]> i make heavy use of indexes in my extension classes. these all inherit from catalogpathaware, so i have to call object.reindex_object() on each changed instance. calling it from attribute getters/setters f.ex. is not a goo

[Zope] automagic reindexing of objects

2005-06-17 Thread Jürgen Herrmann
hi all! i make heavy use of indexes in my extension classes. these all inherit from catalogpathaware, so i have to call object.reindex_object() on each changed instance. calling it from attribute getters/setters f.ex. is not a good idea, because changing 3 attributes will reindex the object 3 time