[Zope] Re: Catalog Anything Problem

Casey Duncan cduncan@kaivo.com
Thu, 03 May 2001 08:26:13 -0600


Bobby Mathew wrote:
> 
> Hi Ron / Casey,
> 
> Thanks for your support, I have made those changes as you guys suggested.
> Firstly i created a new catalog called prods under /learn/search/ and did
> nothing further
> secondly i kept the zsql method outside under the path /learn/search/
> called it getProdtoCatalog()
> it has this code...
> SELECT prodid as Number, Title,
> Descr || ' ' || Title as PrincipiaSearchSource,
> 'Product' as meta_type, prodid as id, Descr as summary
> FROM products
> 
> now i went within /learn/search/prods and put catalogProducts (python
> script) with this code
> for Product in container.getProdtoCatalog():
>     container.catalog_object(Product,
>     '/learn/search/prods/'+ Product.Number +'/proddetails.html')
>     print 'Product #' + Product.Number
> return printed
> 
> The moment i test this it gives me this error
> 
> Zope Error
> Zope has encountered an error while publishing this resource.
> 
> Error Type: AttributeError
> Error Value: Number

[snip]

Try Product.number, Databases often return field names in all lower case
regardless of the case specified in the SQL.

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>