[Zope-Checkins] CVS: Zope3/lib/python/Persistence - _persistent.py:1.1.2.9
Jeremy Hylton
jeremy@zope.com
Mon, 11 Feb 2002 19:43:09 -0500
Update of /cvs-repository/Zope3/lib/python/Persistence
In directory cvs.zope.org:/tmp/cvs-serv4777
Modified Files:
Tag: Zope-3x-branch
_persistent.py
Log Message:
Change the way _p_state is computed when the current state is ghost
and the value of _p_changed is true or false. Always set the state to
up-to-date explicitly. The old code used "not not state", but state
had to be None. So "not not state == 0" and "0" is clearer.
Replace assignment to _p_atime with _p_time. The interface documents
_p_time but not _p_atime.
=== Zope3/lib/python/Persistence/_persistent.py 1.1.2.8 => 1.1.2.9 ===
# Ghost. Note val can't be None, cuz then val would equal state.
self._p_jar.setstate(self)
- self._p_state = not not state
+ self._p_state = 0
def _p_del_changed(self):
if self._p_jar is None or self._p_oid is None:
@@ -96,7 +96,7 @@
if dm is not None:
setstate(self, dm, 0)
- object.__setattr__(self, '_p_atime', int(time() % 86400))
+ object.__setattr__(self, '_p_time', int(time() % 86400))
return object.__getattribute__(self, name)