Cataloging a ZSQL database
Hi, 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, '('), '(') 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 I would be very grateful for any help, as I'm completely stuck on this - even an example zexp file of this or a similar implementation would be hugely appreciated.... Many thanks in desperation, Clara _________________________________________________________________ Charla con tus amigos en lĂnea mediante MSN Messenger: http://messenger.yupimsn.com/
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
Clara Baiget wrote:
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, '('), '(')
Seems like your database has problems with the concat operator. You'll need to find out how you can do a similar operation in your database's dialect of SQL. (Of course, you could not have a concatenated field for your PrincipiaSearchSource.) --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
participants (3)
-
Clara Baiget -
Dieter Maurer -
J. Cameron Cooper