[Zope] Automatically adding properties (keywords) to folders

2006-04-20 Thread Terry Jones
I'd like to set up a folder in Zope with the property that when an object
is put into it, the object has a keyword added to it automatically (and
when the object is moved out of the folder, the keyword is removed).

If you could do this, you would have a nice way to maintain a collection of
such folders and have their contents appear elsewhere in a collection of
Plone Smart Folders (using keyword criteria).

Can anyone tell me how I should best go about doing this?

I can imagine writing some python to run once in a while, find all the
contents of the folder, add the keywords, etc. But that's far from being an
ideal solution.

Any pointers would be much appreciated.

Regards,
Terry
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Automatically adding properties (keywords) to folders

2006-04-20 Thread Dieter Maurer
Terry Jones wrote at 2006-4-20 17:30 +0200:
I'd like to set up a folder in Zope with the property that when an object
is put into it, the object has a keyword added to it automatically (and
when the object is moved out of the folder, the keyword is removed).

Thus, you want to customize the folder's _setObject and _delObject.

Define your own Folder class deriving from Zope's standard 'Folder'
and reimplement _setObject and _getObject the way you like.

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )