[Zope] Modifying a zclass property
Stefan H. Holek
stefan@epy.co.at
Mon, 23 Jun 2003 20:34:21 +0200
You cannot assign to attributes of an object from restricted Python.
What you probably want is:
eprops = context.propertysheets.ExhibitProperties
eprops.manage_changeProperties(last_meal_time=DateTime())
Hope this helps,
Stefan
On Montag, Jun 23, 2003, at 19:19 Europe/Vienna, Fernando Martins wrote:
>
> 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.
>
>
--
The time has come to start talking about whether the emperor is as well
dressed as we are supposed to think he is. /Pete McBreen/