[Zope] RE: Catalog Anything Problem

Ron Bickers rbickers@logicetc.com
Wed, 2 May 2001 11:59:12 -0400


> -----Original Message-----
> From: Bobby Mathew [mailto:bobby@dialognet.com]
> Sent: Wednesday, May 02, 2001 2:08 AM
> To: rbickers@logicetc.com
> Cc: zope@zope.org
> Subject: Catalog Anything Problem
>

> Since i am a newbie i was not sure what you meant in the
> cataloganything doc when you said...
> =============
> Setting Up the Catalog ...

I meant exactly what you did, set up the catalog as you would for any type
of search.

> postgres. So i just didnt do anything further. I have a products
> table in the postgres rdbms that i want to search by title and
> description. So after this i created a zsql method called
> getProdtoCatalog under the ZCatalog itself - the query i used is

> Now i went into the Find Objects section and searched for the
> getProdtoCatalog zsql method and added to the catalog

As mentioned by Casey, this is not necessary.  In fact, you want these *not*
in the catalog.

> Next i went and created the python script (again under the
> Products ZCatalog itself) and i called it catalogProducts this is
> the code inside
> for book in container.getProdToCatalog():
>     container.catalog_object(Product,
>     '/learn/search/Products/'+Product.Number+'/proddetails.html')
>     print 'Product #' + Product.Number
> return printed

Your first parameter to catalog_object is 'Product', but there is no such
object.  It should probably read:

  for Product in container.getProdToCatalog():

This, BTW, pointed me to the same mistake in the catalogArticles() Python
script of my HowTo, which I just fixed.

Also, is it getProdToCatalog or getProdtoCatalog?  Case is important and
this may be why you're getting the exception.

_______________________

Ron Bickers
Logic Etc, Inc.
rbickers@logicetc.com