Using @@plone_interface_info View
I hadn't heard of this one, but it came up on #plone when Joel Burton was looking for ideas on how to test if an object was a working copy in a short condition.
python: not object.restrictedTraverse('@@plone_interface_info').provides('plone.app.iterate.interfaces.IWorkingCopy')
Here's the full interface from plone.app.layout.globals:
class IInterfaceInformation(Interface):
"""A view that gives information about interfaces provided by its context
"""
def provides(dotted_name):
"""Given an interface dotted name, determine if the context provides
this interface.
"""
def class_provides(dotted_name):
"""Given an interface dotted name, determine if the context's class
provides this interface.
"""
