本文整理匯總了Python中Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault.providedBy方法的典型用法代碼示例。如果您正苦於以下問題:Python ISelectableBrowserDefault.providedBy方法的具體用法?Python ISelectableBrowserDefault.providedBy怎麽用?Python ISelectableBrowserDefault.providedBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault
的用法示例。
在下文中一共展示了ISelectableBrowserDefault.providedBy方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_isMixedIn
# 需要導入模塊: from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault [as 別名]
# 或者: from Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault import providedBy [as 別名]
def test_isMixedIn(self):
self.assertTrue(isinstance(self.af, BrowserDefaultMixin),
"ISelectableBrowserDefault was not mixed in to ATFolder")
self.assertTrue(ZopeTwoISelectableBrowserDefault.providedBy(self.af),
"ISelectableBrowserDefault not implemented by ATFolder instance")
self.assertTrue(ISelectableBrowserDefault.providedBy(self.af),
"ISelectableBrowserDefault not implemented by ATFolder instance")
示例2: get_target_object_layout
# 需要導入模塊: from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault [as 別名]
# 或者: from Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault import providedBy [as 別名]
def get_target_object_layout(self, target):
"""
Returns target object 'view' action page template
"""
if ISelectableBrowserDefault.providedBy(target):
return target.getLayout()
else:
return 'base_view'
示例3: rename_default_page
# 需要導入模塊: from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault [as 別名]
# 或者: from Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault import providedBy [as 別名]
def rename_default_page(obj, event):
newParent = event.newParent
if newParent != event.oldParent:
return
elif ISelectableBrowserDefault.providedBy(newParent):
default_page_id = newParent.getProperty('default_page', '')
if default_page_id == event.oldName:
ISelectableBrowserDefault(newParent).setDefaultPage(event.newName)
示例4: rename_default_page
# 需要導入模塊: from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault [as 別名]
# 或者: from Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault import providedBy [as 別名]
def rename_default_page(obj, event):
"""event subscriber, rename default page if targte was renamed
used by default for zope.lifecycleevent.interfaces.IObjectMovedEvent
"""
newParent = event.newParent
if newParent != event.oldParent:
return
elif ISelectableBrowserDefault.providedBy(newParent):
default_page_id = newParent.getProperty("default_page", "")
if default_page_id == event.oldName:
ISelectableBrowserDefault(newParent).setDefaultPage(event.newName)
示例5: getTargetObjectLayout
# 需要導入模塊: from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault [as 別名]
# 或者: from Products.CMFDynamicViewFTI.interfaces.ISelectableBrowserDefault import providedBy [as 別名]
def getTargetObjectLayout(self, target):
"""
Returns target object 'view' action page template
"""
if HAS_ISBD and ISelectableBrowserDefault.providedBy(target):
return target.getLayout()
else:
view = target.getTypeInfo().getActionById('view') or 'base_view'
# If view action is view, try to guess correct template
if view == 'view':
view = target.portal_type.lower() + '_view'
return view