[Zope] bobo_mod_time difference in zcat vs object

Chris McDonough chrism@digicool.com
Thu, 15 Mar 2001 15:26:17 -0500


Hi Joel,

Because bobobase_modification_time is kept as metadata, it isn't updated
until you reindex the object.

To do this, when an object is changed, immediately reindex it the catalog by
calling:

<dtml-call "yourcatalog.catalog_object(object, object.getPhysicalPath())">

In versions of Zope 2.3.1b2 and greater, you can just do:

<dtml-call "yourcatalog.catalog_object(object)">

... and it will do the right thing.


----- Original Message -----
From: "Joel Burton" <jburton@scw.org>
To: <zope@zope.org>
Sent: Thursday, March 15, 2001 2:52 PM
Subject: [Zope] bobo_mod_time difference in zcat vs object


>
> First of all, apologies for the dozen questions over the past week. Zope's
> learning curve gets very steep as one takes the first steps through the
> API, and the many responses here have been very helpful.
>
>
> I have a series of books that are JBook ZClass objects. They
> (naturally) have a bobobase_modification_time of when the instance was
> last modified.
>
> I have a catalog, BookCatalog, that holds the JBooks. The default index
> for bobo_mod_time is and default metadata for it are there.
>
> If I clear the catalog, re-find JBooks and look in the catalog
> values, I can see that a particular book has a bobo_mod_time of today.
>
> But: when I iterate over the query results, I see a bobo_mod_time of
> yesterday.
>
> For example:
>
>
> <dtml-in "Catalog.searchResults(meta_type=['JBook'])"
>           sort=bobobase_modification_time reverse>
>
>   <dtml-var title>
>
>   from_obj:
>   <dtml-var "getObject().bobobase_modification_time()">
>
>   from_cat:
>   <dtml-var bobobase_modification_time>
>
> </dtml-in>
>
>
> returns different values for my book from_obj (today) and from_cat
> (yesterday), even though when I looked in the cat, I see today for
> bobo_mod_time.
>
> What I'd like is the bobo_mod_time of today, since that's when I actually
> changed the object!
>
> I've cleared and re-found my objects, and this doesn't fix the problem. I
> am not using RAM cache or any other (intentional) caching objects.
>
> Any ideas?
>
> Thanks!
> --
> Joel Burton   <jburton@scw.org>
> Director of Information Systems, Support Center of Washington
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>