[Zope] Cataloging a ZSQL database

Dieter Maurer dieter at handshake.de
Fri Nov 7 16:27:09 EST 2003


Clara Baiget wrote at 2003-11-6 22:38 +0000:
 > I am a fairly new user to zope, and although I know the basics, I am
 > having problems trying to catalog a zsql database. Fortunately I found this 
 > Ho-to on the Zope site, which explains how to do this:
 > http://www.my-zope.org/HowtosRating/20020109160026
 > But following their example, when I create the getBooksToCatalog
 > method, Test then hit the "Submit Query" button, I get the following
 > error:
 > 
 > Error, exceptions.SyntaxError: unexpected token sequence.near :: ',
 > Title,\nconcat'*'(Description, T' *******************************
 > current state = 45 expects: '.', ('nomatch1',) current token = ((-
 > 6, '('), '(')

This looks as if your database would not understand "concat"...
Are you using "Gadfly"? Don't, use Postgres or MySQL instead.

 > when I remove the following line, it returns results:
 > concat(Description, Title, Author) as PrincipiaSearchSource,
 > however after this point if I remove this line and proceed to
 > catalogBooks and "Test" I get the following error:
 > 
 > Error Type: AttributeError
 > Error Value: catalog_object

Remember for the future:

  Whenever you see an exception, look at the traceback (to be found
  in "/error_log"). It tells you precisely where the error occured.

Almost surely, you try to use "catalog_object" on something that
is not a "ZCatalog" object.
Look at the traceback where "catalog_object" is used.
Fix this use and ensure that it is used for a ZCatalog object.

-- 
Dieter



More information about the Zope mailing list