[Zope] Delete properties and objects

Rik Hoekstra rik.hoekstra@inghist.nl
Sun, 2 Apr 2000 22:33:12 +0200


-----Original Message-----
From: Sin Hang Kin <iekentsin@infoez.com.mo>
To: Zope Admin list <zope@zope.org>
Date: vrijdag 31 maart 2000 15:50
Subject: [Zope] Delete properties and objects


>How dtml be used to emulate the manage* interface to change and delete
>properties and DTML documents.


Um, what about ( untested, but it should work)

<dtml-call "manage_delProperties([ids, REQUEST])">, in which ids refer to
the properties.
On a specific object that would be:
<dtml-with <yourobject>>
  <dtml-call "manage_delProperties([ids, REQUEST])">
</dtml-with>

or <dtml-call "<yourobject>.manage_delProperties([ids, REQUEST])">


Note, however, that the ids argument is a list. SO put the ids between
square brackets, like
<dtml-call "<yourobject>.manage_delProperties([id1,id2,id3], REQUEST])">

A form calling the method should also provide a list argument for ids. If
you want to do something of the sort, I suggest you adapt the
manage_propertiesForm from Zope to your needs.

Calling from a URL (for example from a href in a dtml document) is also
possible. Do it like this (tested!):

http://localhost:8080/test/manage_delProperties?ids:list=<property1>&ids:lis
t=<property2>

>
>The editonly properties howto involved some python code were too complex
for
>me.


I don't know that one, so I can't comment.

>
>If I just use the manage method, it will re-direct me to the manage screen
>which is not good.
>

For object, just change the Properties with objects in the above (and also
see the ZQR).

hth

Rik