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
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 )
On Friday 16 March 2001 04:26, Chris McDonough wrote:
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())">
is this synonymous with <dtml-call "reindex_object">?
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.
hope to test out the new ZCatalog soon. and tell all the Pros to keep up the great work! thanks
On Thu, 15 Mar 2001, Chris McDonough wrote:
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)">
Even when I clear the catalog and re-find all the objects? Is the old metadata still hanging around? Thanks! P.S. We're supposed to thank you and supply you with beer for your work on beta2, so thanks, and cheers! :-) -- Joel Burton <jburton@scw.org> Director of Information Systems, Support Center of Washington
Even when I clear the catalog and re-find all the objects?
Is the old metadata still hanging around?
It seems to be! This is probably a bug. All I can do is <duck> ask you to upgrade to Zope 2.3.1b2. The catalog code is all switched around in 2.3.1b2 from versions prior, and trying to patch the old stuff is something I don't even want to think about.
P.S. We're supposed to thank you and supply you with beer for your work on beta2, so thanks, and cheers! :-)
Thanks! Also thank Andreas Jung and most of all Jim Fulton, who I think has finally tamed the Catalog beast in 2.3.1b2 (knock on wood!)
BTW, also thank Steve Alexander for submitting lots of bug reports with patches!! ----- Original Message ----- From: "Chris McDonough" <chrism@digicool.com> To: "Joel Burton" <jburton@scw.org> Cc: <zope@zope.org> Sent: Thursday, March 15, 2001 3:37 PM Subject: Re: [Zope] bobo_mod_time difference in zcat vs object
Even when I clear the catalog and re-find all the objects?
Is the old metadata still hanging around?
It seems to be! This is probably a bug. All I can do is <duck> ask you to upgrade to Zope 2.3.1b2. The catalog code is all switched around in 2.3.1b2 from versions prior, and trying to patch the old stuff is something I don't even want to think about.
P.S. We're supposed to thank you and supply you with beer for your work on beta2, so thanks, and cheers! :-)
Thanks! Also thank Andreas Jung and most of all Jim Fulton, who I think has finally tamed the Catalog beast in 2.3.1b2 (knock on wood!)
_______________________________________________ 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 )
participants (3)
-
bak -
Chris McDonough -
Joel Burton