[Zope] changing property in __call__ without undo log entry (counter)

Dieter Maurer dieter@handshake.de
Mon, 22 Apr 2002 22:10:52 +0200


Marcus Schopen writes:
 > how to change counter's value without getting an undo log entry:
 > 
 >     def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw):
 > 	[...]
 > 	
 > 	self.counter = self.counter + 1
Do not modify a persistent object and you will not get an transaction
log entry...

You may look at "SharedResource"

  <http://www.dieter.handshake.de/pyprojects/zope>

to separate the counter from the object (and do not modify the object).

When your counter may be volatile (i.e. be reset non-deterministically,
you can use a non-persistent attribute. Their name starts with
"_v_".


Dieter