[Zope-dev] ZPatterns AttributeProvider question

Steve Alexander steve@cat-box.net
Sun, 22 Apr 2001 18:25:21 +0100


Phillip J. Eby wrote:

> Steve Alexander wrote:
> 
>>  As a simpler workaround, you can use 
>>your_object.commitSubtransaction() instead of redirecting to a new page. 
>>
> Um, this shouldn't be the issue here.  _SetAttributeFor() should be called
> when the attribute is set; it's not transaction-driven.  Something weird is
> happening with Christian's situation that I haven't investigated yet.


I agree. However, if Christian's problem can be worked-around by 
redirecting before setting attributes, then it should also be 
workaroundable by calling commitSubtransaction.


> Actually, the status should be AddedStatus, and it should stay that way
> throughout the transaction, unless the object gets deleted in the same
> transaction.


That's what I'd originally thought. Then I (mis-?)read the code again...

The __set_attr__ method of DataSkins.py says:

    self._objectChanging(name)

The _objectChanging method says:

     if self._v_status_ is not ChangedStatus:
         d[_v_dm_]._objectChanging(self)
         d[_v_status_] = ChangedStatus

I don't see an exception for if _v_status is already AddedStatus.

--
Steve Alexander
Software Engineer
Cat-Box limited