[Zope] How to change the properties of a ZClass instance

Casey Duncan cduncan@kaivo.com
Tue, 19 Jun 2001 09:11:18 -0600


> Jan Lentfer wrote:
> 
> Hi everyone,
> 
> I am having a hard time changing the properties of an ZClass instance.
> 
> This is what I have done so far:
> 
> I created a producted called MTB_HQ. Within that product I created the
> ZClass "racedate". The ZClass has the a propertysheet called
> "date_properties".
> The sheet contains the properties
> "date_day","date_month","date_year","date_sort","title","discipline","location".
> All string type.
> 
[snip]

> My idea is to create a web form that is filled with the properties of
> existing ZClass. The you can make changes and the form calls a method
> that does the changing of the properties. But how do I do that?

Create the form as an instance method of the ZClass (under the methods
tab). Then just insert the property values like:

<input type="text" name="location" value="&dtml-location;">

Make sure that the names of the form fields match exactly with your
property names.

[snip]
> 
> 
> How should the dtml-method "changeracedate.dtml" look like? Or could
> one of you guys point my nose at the right doc or how-to?
> I have really been playing around with this quite a while and just
> can't figure out how to use mange_changeProperties right!
> 

The action method (which should also be an instance method of the
ZClass) should look something like this:

<dtml-call
expr="propertysheets.date_properties.manage_changeProperties(REQUEST)">
<dtml-call name="reindex_object">   <--- If it is CatalogAware
<dtml-call expr="REPONSE.redirect('index_html')">

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>