[Zope-CMF] __setattr__ in a persistent class

Gregoire Weber gregweb at gmx.ch
Mon Aug 11 13:47:54 EDT 2003


Hi Chris,

thanks for your answer!

>>Q: Somebody on the list, knowing how to intercept attribute    setting and getting with __setattr__ and __getattr__ in    a persistent subclass?
>
>A: Don't do this, explain what your problem is and fidn a better solution :-)

The goal was to be able to attach another workflow to a content object if it 
gets copied into a collection. 

I'll now figured out to solve that problem by duplicating the content 
objects in the types tool by registering under a new 'portal_type' 
(e.g. 'Image' --> 'Image_'). I'll change the 'portal_type' of a content 
object when added to a collection (e.g. from 'Image' to 'Image_').

In DCWorkflow I'll attach another Workflow to 'Image_'.

I tested that quickly and it worked as expected.

[snipped]

Gregoire
_____________________________________
Grégoire Weber
mailto:gregoire.weber at switzerland.org




More information about the Zope-CMF mailing list