[Zope-dev] Bug in Changed events in ZPatterns 0.4.0a1?

2000-06-19 Thread Itamar Shtull-Trauring

As far as I can tell, the first time an object is changed, an Agent's
_objectChanged() will be called, but as long as the object is still in the
memory cache, _objectChanged() will not be called again.

That is, I change an object - _objectChanged() is called.  However, the
object is now in the memory cache, so the next time I change the object,
_objectChanged() is not called.  If I flush the cache, or Refresh the
Product, the next _objectChanged() will be honored (but the next-next one
won't.)

Alternatively, I may be misunderstanding something about the way these
events work.

Another problem I'm having is giving default values to objects (e.g. default
UNAPPROVED status for approval).  I can do this with a trigger (whith
objectAdded being "client.status = UNAPPROVED"), but I also have a trigger
that is equivalent to CatalogAwareness. The problem is that I don't know
what order the triggers get called - will the changes made by one trigger be
consistently cataloged by the other trigger?

-- 
Itamar S.T.  [EMAIL PROTECTED]
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Bug in Changed events in ZPatterns 0.4.0a1?

2000-06-19 Thread Phillip J. Eby

At 11:33 AM 6/19/00 +0300, Itamar Shtull-Trauring wrote:
As far as I can tell, the first time an object is changed, an Agent's
_objectChanged() will be called, but as long as the object is still in the
memory cache, _objectChanged() will not be called again.

_objectChanged is a once per object per transaction event.


Another problem I'm having is giving default values to objects (e.g. default
UNAPPROVED status for approval).  I can do this with a trigger (whith
objectAdded being "client.status = UNAPPROVED"), but I also have a trigger
that is equivalent to CatalogAwareness. The problem is that I don't know
what order the triggers get called - will the changes made by one trigger be
consistently cataloged by the other trigger?

I would suggest that you set up an attribute provider for client.status
that returns UNAPPROVED.  Since attribute providers are only active if the
attribute does not exist, this should solve your problem.

As for trigger ordering, they are guaranteed to be called in their plugin
sequence for a given object, but the order of objects they will be called
on is not guaranteed.  However, if a trigger is shared between two
DataManagers (Customizers, Racks, Specialists, etc.), it may be called
sooner than expected from the point of view of one of the DataManagers'
plugin sequences.


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )