Attribute Error while adding ZSearch Interface
Hi Everyone, I am trying to add a ZSearch Interface to a website which contains around 3500 objects. I have a ZCatalog instance in the same folder. But while adding ZSearch Interface I am getting an Attribute Error the error_log says as follows. Attribute Error: _catalog Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.ZRDB.Search, line 47, in manage_addZSearch Module Products.ZCatalog.ZCatalog, line 593, in _searchable_arguments AttributeError: _catalog I am using Zope 2.6.0, I am new to ZCatalog hence it is quite possible that I am doing something wrong while setting it up. I also looked in to the ZCatalog.py as suggested by the traceback but I couldn't find the exact cause of error. Any information on this is deeply appreciated. Thanks in Advance Shashank Ashtikar
Shashank Ashtikar wrote at 2003-4-22 14:06 +0530:
I am trying to add a ZSearch Interface to a website which contains around 3500 objects. I have a ZCatalog instance in the same folder. But while adding ZSearch Interface I am getting an Attribute Error the error_log says as follows.
Attribute Error: _catalog
Traceback (innermost last): Module ZPublisher.Publish, line 98, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 39, in call_object Module Shared.DC.ZRDB.Search, line 47, in manage_addZSearch Module Products.ZCatalog.ZCatalog, line 593, in _searchable_arguments AttributeError: _catalog
Looks at if your "Catalog" instance were broken: "ZCatalog" is a tiny wrapper around "Catalog". The "Catalog" instance is maintained as "_catalog" of the "ZCatalog" instance. Is your "ZCatalog" usable at all? (I doubt it). Dieter
Hi,
Looks at if your "Catalog" instance were broken:
"ZCatalog" is a tiny wrapper around "Catalog". The "Catalog" instance is maintained as "_catalog" of the "ZCatalog" instance.
Is your "ZCatalog" usable at all? (I doubt it).
The ZCatalog is usable but error in my opinion is some where else. I came to this conclusion after doing some more hacking on the problem. This what is puzzling me: I have a python class which inherits from ZCatalog I have lot of instances of this class. Thus in the add form for ZSearch Interface all these instances were being listed. So when I choose one of these instances I get the mentioned attribute error. But when I choose a actual ZCatalog instance the form woks perfectly fine. I can do with this. But now I have a problem if, I inherit a class from ZCatalog doesnt that mean that this class is catalog aware. I thought that since the class is catalog aware it should work with the form. Any way to me it looks like some bigtime confusion on my part. Guess it's time to read the Zope Book again ;-). Thanks Shashank Ashtikar
Shashank Ashtikar wrote:
But now I have a problem if, I inherit a class from ZCatalog doesnt that mean that this class is catalog aware.
No. You have to inherit form CatalogPathAwareness.CatalogPathAware. Have a look at lib/python/Products/ZCatalog/CatalogPathAwareness.py.
I thought that since the class is catalog aware it should work with the form. Any way to me it looks like some bigtime confusion on my part. Guess it's time to read the Zope Book again ;-).
Reading the Zope-Book is a good idea, but maybe you should read the Developers-Guide as well. -mj
Shashank Ashtikar wrote at 2003-4-24 12:10 +0530:
...
Looks at if your "Catalog" instance were broken:
"ZCatalog" is a tiny wrapper around "Catalog". The "Catalog" instance is maintained as "_catalog" of the "ZCatalog" instance.
Is your "ZCatalog" usable at all? (I doubt it).
The ZCatalog is usable but error in my opinion is some where else. I came to this conclusion after doing some more hacking on the problem.
This what is puzzling me:
I have a python class which inherits from ZCatalog I have lot of instances of this class. Thus in the add form for ZSearch Interface all these instances were being listed. So when I choose one of these instances I get the mentioned attribute error. But when I choose a actual ZCatalog instance the form woks perfectly fine. I can do with this.
This means, you inherited "ZCatalog" but did not call its "__init__" method. When you override a method, it is sometime necessary to call the method of the inherited class in your class... Dieter
participants (3)
-
Dieter Maurer -
Maik Jablonski -
Shashank Ashtikar