[Zope] Adding properties to all objects of a certain type

Cornelis J. de Brabander brabander@fsw.LeidenUniv.nl
Tue, 27 Feb 2001 09:24:36 +0100


I would create a DTML method that wraps the manage_addProperty method like
this and view it by pressing the 'view' tab (tested):

<dtml-in "objectValues(['Folder'])">
 <dtml-unless reviewed>
  <dtml-call "manage_addProperty('reviewed',1,'boolean')">
 </dtml-unless>
</dtml-in>

You should expand this to meet your specific needs.

Of course the proper way to do things such as this is by means of a Python
script, but to my disgrace I'm still a lot more familiar with DTML than with
Python
hth

Cornelis J. de Brabander
==========================================
Department of Education, Leiden University
P.O.Box 9555, NL-2300 RB Leiden
+31 71 527 3422/3401
brabander@fsw.leidenuniv.nl
==========================================

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Carl
> Blesius
> Sent: maandag 26 februari 2001 18:55
> To: zope@zope.org
> Subject: [Zope] Adding properties to all objects of a certain type
>
>
> I want to add certain properties to objects of a certain type without
> having to use the web interface (there are too many of them)...
>
> e.g. I would like to add the following properties to all folders:
> title_en (string), nickname (string), nickname_en (string), template
> (string), reviewed (boolean)
> and the following to all DTML-Documents:
> lang (string), nickname (string), template (string), keywords (string),
> author (string), reviewed (boolean)
>
> A few documents and folders on the site have these properties already (is
> this a problem?).
>
> And after I add these properties to all documents and folders how do I get
> Zope to add them to new ones automatically?
> I want to keep everything as simple as possible... i.e. no Z Class to
> worry about when upgrading, etc.
>
> Concrete examples would be appreciated (theoretically I know it is
> possible with Zope considering what I have been able to do up to this
> point as a greenhorn!).
>
> Thanks,
>
> Carl.
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>