Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Web Plone Snippets and Examples Using @@plone_interface_info View

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.
"""
Document Actions

Comments (0)

« May 2012 »
May
MoTuWeThFrSaSu
123456
78910111213
14151617181920
21222324252627
28293031