======================== Object Introspector View ======================== The "Introspector" view provides access to information about the current obejct, the context of the introspector view. When in `devmode`, the introspector is simply available as follows: >>> from zope.testbrowser.testing import Browser >>> browser = Browser() >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw') >>> browser.handleErrors = False >>> browser.open('http://localhost/manage') >>> browser.getLink('Introspector').click() The page starts with telling you the class/type >>> browser.getLink('zope.app.folder.folder.Folder').url 'http://localhost/++apidoc++/Code/zope/app/folder/folder/Folder/index.html' and the name of the object: >>> '<no name>' in browser.contents True Of course, the root folder does not have a name. As you can see the type links directly to the API documentation of the class. The next section lists all directly provided interfaces. The root folder directly provides the ``ISite`` and ``IRootFolder`` interface, so we should see those: >>> browser.getLink('zope.app.component.interfaces.ISite').url '.../++apidoc++/Interface/zope.app.component.interfaces.ISite/index.html' >>> browser.getLink('zope.app.folder.interfaces.IRootFolder').url '...apidoc++/Interface/zope.app.folder.interfaces.IRootFolder/index.html' The next two section, the implemented interfaces and the base classes, are not instance specific pieces of information, but they are still nice to see at this point. For example, a ``Folder`` instance provides the following interfaces: >>> browser.getLink('zope.app.folder.interfaces.IFolder').url '.../++apidoc++/Interface/zope.app.folder.interfaces.IFolder/index.html' >>> browser.getLink('persistent.interfaces.IPersistent').url '.../++apidoc++/Interface/persistent.interfaces.IPersistent/index.html' >>> browser.getLink('zope.app.component.interfaces.IPossibleSite').url '.../Interface/zope.app.component.interfaces.IPossibleSite/index.html' >>> browser.getLink('zope.app.container.interfaces.IContained').url '...doc++/Interface/zope.app.container.interfaces.IContained/index.html' The base classes of the ``Folder`` are as follows: >>> browser.getLink('persistent.Persistent').url 'http://localhost/++apidoc++/Code/persistent/Persistent/index.html' >>> browser.getLink('zope.app.component.site.SiteManagerContainer').url '...apidoc++/Code/zope/app/component/site/SiteManagerContainer/index.html' >>> browser.getLink('zope.app.container.contained.Contained').url '.../++apidoc++/Code/zope/app/container/contained/Contained/index.html' Now that we described the component and class level of the object, the view dives into some details. First it lists the attributes/properties of the object, including the value of the attribute. This is information can be very useful when debugging an application. The only attribute of the folder is the data attribute: >>> print browser.contents Attributes/Properties
data
...
<BTrees._OOBTree.OOBTree object at ...>
get(name, default=None)
Return ...
u'file.txt'
<zope.app.file.file.File object at ...>
(type:
ContainedProxy
)
'zope.app.dublincore.ZopeDublinCore'
<...annotatableadapter.ZDCAnnotationData ...>
(type:
ZDCAnnotationData
)
data
(type:
dict
)
{u'Date.Modified': (u'...',), u'Creator': (u'zope.mgr',)}