[Zope] Need ZCatalog help

John Goerzen jgoerzen@complete.org
09 Sep 1999 22:22:35 -0500


Here I am talking to myself again :-)

I have two more questions to go along with the below.

I have made a ZCatalog up near the top of my tree named
EventsCatalog.  I have a method named getEventsByDate that now usses
this.  This method works fine if invoked directly, but if not, it
claims it can't find EventsCatalog -- even if both the method and the
caller are clearly below EventsCatalog in the tree, thus acquisition
should step in.

Here's the code:

<dtml-with "_(myEventList=[])">
  <dtml-in "EventsCatalog.searchResults({'when' :
   [startDate, endDate], 'when_usage' : 'range:min:max'})">
    <dtml-call "myEventList.append(EventsCatalog.resolve_url('/' +
EventsCatalog.getpath(data_record_id_),
REQUEST=REQUEST))"></dtml-comment>
</dtml-in>
<dtml-return myEventList>
</dtml-with>

Now, it is aborting at searchResults.

Secondly, the search string *may* be working, but I don't understand
the syntax.  What do the colons and the curly braces signify?  Why is
"_usage" significant?  What exactly does 'range:min:max' indicate?

Thanks!

John Goerzen <jgoerzen@complete.org> writes:

> Hi!
> 
> OK, it looks like I've been doing things a stupid way by not using
> ZCatalog.  I managed to find a ZCatalog.txt buried deep within the
> source, but I'm a bit stuck now.
> 
> First.  I created a ZClass in my own Application with my Events
> class.  Do I need to delete it and recreate it so that it lists
> ClassAware as one of its meta types?
> 
> When a class is ClassAware, how does it know into which catalog new
> items should go?  I haven't been able to make the thing update
> catalogs automatically.
> 
> What is the purpose of using the Contents tab of a ZCatalog to
> actually add items inside it?  What are the pros/cons of doing this?
> Why are these objects not automatically cataloged?
> 
> Where can I find a reference on the syntax of searching a catalog?
> 
> Thanks,
> 
> John
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
> 
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )
> 

-- 
John Goerzen   Linux, Unix consulting & programming   jgoerzen@complete.org |
Developer, Debian GNU/Linux (Free powerful OS upgrade)       www.debian.org |
----------------------------------------------------------------------------+
The 46,834th digit of pi is 1.