[Zope3-Users] Re: How to test for object metatype

Philipp von Weitershausen philipp at weitershausen.de
Mon Apr 18 08:12:45 EDT 2005


Cliff Ford wrote:
> Thanks for the help. I 'discovered' the isinstance method in the ZAPI 
> Reference of your book, which is just what I needed.

Note that with isinstance, you check for a certain implementation, not 
for functionality. In general, that is not preferrable because 
implementations may change, interfaces usually don't.

So, for filtering, it's preferrable to use ISomeInterface.providedBy(obj)

> I put the filter method in the custom content class rather than a
> separate view class. It all seems to work so I am progressing again.

Putting display filtering in a content class is not quite a kosher way 
to go. You should filter in the browser view.

Philipp



More information about the Zope3-users mailing list