index_object() in CatalogPathAwareness
Hi! I think a CatalogPathAware object should raise an exception if there is no "default_catalog". I think it is not good that it does silently nothing: CatalogPathAwareness.py: def index_object(self): """A common method to allow Findables to index themselves.""" if hasattr(self, self.default_catalog): getattr(self, self.default_catalog).catalog_object(self, self.getPath()) What do you think? thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
Except then it would be impossible to add CatalogAware objects with no catalog, and the error would be pretty obscure to most users. Maybe it should write a BLATHER level entry to the log file instead. -Casey On Monday 02 December 2002 03:19 pm, Thomas Guettler wrote:
Hi!
I think a CatalogPathAware object should raise an exception if there is no "default_catalog". I think it is not good that it does silently nothing:
CatalogPathAwareness.py:
def index_object(self): """A common method to allow Findables to index themselves.""" if hasattr(self, self.default_catalog): getattr(self, self.default_catalog).catalog_object(self, self.getPath())
What do you think?
thomas
-- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
From: "Casey Duncan" <casey@zope.com>
Except then it would be impossible to add CatalogAware objects with no catalog, and the error would be pretty obscure to most users.
Maybe it should write a BLATHER level entry to the log file instead.
I wouldn't even go that far. I think the current behaviour is the most reasonable default, and for any non-trivial implementation you end up overriding index_object() anyway. :-)
On Mon, Dec 02, 2002 at 10:26:08PM +0100, Lennart Regebro wrote:
From: "Casey Duncan" <casey@zope.com>
Except then it would be impossible to add CatalogAware objects with no catalog, and the error would be pretty obscure to most users.
Maybe it should write a BLATHER level entry to the log file instead.
I wouldn't even go that far. I think the current behaviour is the most reasonable default, and for any non-trivial implementation you end up overriding index_object() anyway. :-)
Now I know this, too. It is one of the many magics I don't like about Zope. Nevertheless Zope rocks. My boss asked my to write a little demo today. It was done in some hours. This won't be possible with Cocoon, Enhydra or PHP. Thomas -- Thomas Guettler <guettli@thomas-guettler.de> http://www.thomas-guettler.de LocalWords: Except
participants (3)
-
Casey Duncan -
Lennart Regebro -
Thomas Guettler