Discussion:
[Erp5-dev] possible bugs in ZSQLCatalog.py
Alexey Morozov
2005-07-01 05:28:17 UTC
Permalink
Hello!

It seems there's a bug in ZSQLCatalog/ZSQLCatalog.py or I use it somehow
incorrectly (really don't know what's wrong).

I told yesterday that I got the following error after clicking on 'Find
and catalog' button in 'Find objects' tab. Here's the traceback:

---------------------------------
Traceback (innermost last):

* Module ZPublisher.Publish, line 175, in publish_module_standard
* Module Products.iHotfix, line 88, in new_publish
* Module ZPublisher.Publish, line 132, in publish
* Module Zope.App.startup, line 204, in zpublisher_exception_hook
* Module ZPublisher.Publish, line 101, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 39, in call_object
* Module Products.ZSQLCatalog.ZSQLCatalog, line 551, in
manage_catalogFoundItems

NameError: global name 'time' is not defined (Also, an error occurred
while attempting to render the standard error message.)
--------------------------------

The problem code is

--------------------
obj_roles=obj_roles, obj_permission=obj_p

-> elapse = time.time()
-> c_elapse = time.clock()

words = 0
--------------------

Indeed the module doesn't import time at all and I could find any place
where it could be imported implicitly.

When I fixed that error (by adding import time), I was faced w/ another
missing import: urllib is used at line 578 but isn't imported.

I played w/ ZSQLCatalog-0.9-1mdk - derived RPM, but as I can see in CVS,
there's no corresponding fixes in trunk.
Yoshinori Okuji
2005-07-01 13:05:36 UTC
Permalink
Hello Alexey,
Post by Alexey Morozov
Indeed the module doesn't import time at all and I could find any place
where it could be imported implicitly.
When I fixed that error (by adding import time), I was faced w/ another
missing import: urllib is used at line 578 but isn't imported.
Thank you very much for your bug report. I have fixed them right now.

YO
--
Yoshinori Okuji, Nexedi Research Director
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org
Storever: OpenBrick, WiFi infrastructure, notebooks and servers
http://www.storever.com
Alexey Morozov
2005-07-01 14:20:01 UTC
Permalink
Post by Yoshinori Okuji
Hello Alexey,
Thank you very much for your bug report. I have fixed them right now.
Fine.

I also patched the ERP5Type/ZopePatch.py to the state where it doesn't
conflict w/ CMF/ZCatalog. The patch isn't final because it still doesn't
support ZCatalog fully (see the comments in the patch), but nevertheless
it works for me.

But I still looking for an introductory documentation about how to
actually use ZSQLCatalog. Could you help me w/ it?

Is there an IRC channel or something to ask ERP5-related questions in
real-time?

Sincerely yours,
Alexey Morozov.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ERP5Type-0.9-alt-ZCatalog-compat.patch
Type: text/x-patch
Size: 1552 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20050701/bac7829c/attachment.bin>
Yoshinori Okuji
2005-07-01 16:24:19 UTC
Permalink
Post by Alexey Morozov
But I still looking for an introductory documentation about how to
actually use ZSQLCatalog. Could you help me w/ it?
There is no such document for ZSQLCatalog, although there are some technical
ones. At the moment, you need to learn it by example or by experience.

I'd recommend using ERP5Catalog rather than ZSQLCatalog directly. If you look
at the contents of portal_catalog in an ERP5 Site (such as in the Live CD),
you can guess a bit.
Post by Alexey Morozov
Is there an IRC channel or something to ask ERP5-related questions in
real-time?
I don't think so.

YO
--
Yoshinori Okuji, Nexedi Research Director
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org
Storever: OpenBrick, WiFi infrastructure, notebooks and servers
http://www.storever.com
Loading...