On Saturday 29 Jun 2002 5:51 pm, Florent Guillaume wrote:
> [Redirecting to zope-dev]
>
> Carl Rendell  <[EMAIL PROTECTED]> wrote:
> > Has anyone on the list ever 'set' the modification or other date
> > attributes on an object in the ZODB? I've looked at the
> > bobobase_modification_time() call and found it looks at an
> > attribute [_p_mtime] for an object, but have yet to discover what
> > controls the setting of that attribute, or if that is the attribute
> > to set?
> >
> > I'm familiar with changing these on items in a file system, but
> > performing the same task on an object in the ZODB has me stumped
> > right now.
>
> I looked a few weeks ago, and it's deep in the C code, and grep-proof
> besides :-) Look in ZODB/cPersistence.c, grep for "'m'" (with single
> quotes).
>
> My conclusion was that it was very tied to the ZODB and that setting
> it would probably break the serial or transaction mechanisms.

That conclusion is correct. _p_mtime is the timestamp of the transaction from 
which that object was loaded. It is used at the end of a transaction if you 
modified an object, to verying that there has not been a newer revision of 
the object since the one that was modified.

If you want to define your own modification time behaviour, the recommended 
approach is to define your own seperate attribute.


_______________________________________________
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 )

Reply via email to