changing property in __call__ without undo log entry (counter)
Hei, 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 It's not a counter product itself, but just a feature I want to put to an existing product without using one of the existing counter products (eg. FSCounter, ThreadSafeCounter etc.) Any ideas? Thanks Marcus -- ,---- [ Marcus Schopen ] | (0> | //\ P.O. Box 10 25 25 | V_/_ 33525 Bielefeld | Germany `---- __________________________________________________ Petition for a Software Patent Free Europe http://petition.eurolinux.org
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
participants (2)
-
Dieter Maurer -
Marcus Schopen