[Zope] Modifying a zclass property

Fernando Martins fmartins@hetnet.nl
Mon, 23 Jun 2003 19:19:36 +0200


Thanks for replying,

From: Andreas Jung [mailto:andreas@andreas-jung.com]
> I don't know the implementations details of the "context" object but
> I consider "context" as read-only. What you want (I think) is to modify
> the REQUEST by
>
> context.REQUEST.set(key, value).
>

Hmm, I can't see how this relates to my problem. Let me rephrase it:

I've a ZClass ZooExhibit with an attribute like this:
ZooExhibit.PropertySheet.ExhibitProperties.last_meal_time

I can access last_meal_time as in
     if (DateTime().timeTime() - context.last_meal_time.timeTime() >  60 *
60 * 8)
(This is being used to show information of an instance of the ZClass)

But I can't change the value of an attribute of the instance with:
     context.last_meal_time = DateTime()

My problem seems to be a lack of good understanding of what is the context
object and its relation with the instance of the ZClass.

Cheers,
Fernando