本文整理汇总了Python中ZODB.PersistentMapping.PersistentMapping.items方法的典型用法代码示例。如果您正苦于以下问题:Python PersistentMapping.items方法的具体用法?Python PersistentMapping.items怎么用?Python PersistentMapping.items使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZODB.PersistentMapping.PersistentMapping
的用法示例。
在下文中一共展示了PersistentMapping.items方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PloneKupuLibraryTool
# 需要导入模块: from ZODB.PersistentMapping import PersistentMapping [as 别名]
# 或者: from ZODB.PersistentMapping.PersistentMapping import items [as 别名]
#.........这里部分代码省略.........
"""Returns Kupu docs formatted as HTML"""
docpath = os.path.join(Globals.package_home(kupu_globals), 'doc')
f = open(os.path.join(docpath, 'PLONE2.txt'), 'r')
_docs = f.read()
return _docs
security.declareProtected(permissions.ManageLibraries, "zmi_docs")
zmi_docs = PageTemplateFile("zmi_docs.pt", globals())
zmi_docs.title = 'kupu configuration documentation'
security.declareProtected(permissions.ManageLibraries, "sanity_check")
sanity_check = PageTemplateFile("sanity_check.pt", globals())
sanity_check.title = 'kupu status'
security.declareProtected(permissions.ManageLibraries, "kupu_config")
kupu_config = PageTemplateFile("kupu_config.pt", globals())
kupu_config.title = 'kupu configuration'
security.declareProtected(permissions.ManageLibraries, "zmi_libraries")
zmi_libraries = PageTemplateFile("libraries.pt", globals())
zmi_libraries.title = 'kupu configuration'
security.declareProtected(permissions.ManageLibraries, "zmi_resource_types")
zmi_resource_types = PageTemplateFile("resource_types.pt", globals())
zmi_resource_types.title = 'kupu configuration'
security.declareProtected(permissions.ManageLibraries,
"zmi_get_libraries")
def zmi_get_libraries(self):
"""Return the libraries sequence for the ZMI view"""
#return ()
def text(value):
return getattr(value, 'text', value)
return [dict([(key, text(value)) for key, value in lib.items()])
for lib in self._libraries]
security.declareProtected(permissions.ManageLibraries,
"zmi_add_library")
def zmi_add_library(self, id, title, uri, src, icon, REQUEST):
"""Add a library through the ZMI"""
self.addLibrary(id, title, uri, src, icon)
REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_libraries')
security.declareProtected(permissions.ManageLibraries,
"zmi_update_libraries")
def zmi_update_libraries(self, libraries, REQUEST):
"""Update libraries through the ZMI"""
self.updateLibraries(libraries)
REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_libraries')
security.declareProtected(permissions.ManageLibraries,
"zmi_delete_libraries")
def zmi_delete_libraries(self, indices, REQUEST):
"""Delete libraries through the ZMI"""
self.deleteLibraries(indices)
REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_libraries')
security.declareProtected(permissions.ManageLibraries,
"zmi_move_up")
def zmi_move_up(self, indices, REQUEST):
"""Move libraries up through the ZMI"""
self.moveUp(indices)
REQUEST.RESPONSE.redirect(self.absolute_url() + '/zmi_libraries')
security.declareProtected(permissions.ManageLibraries,
"zmi_move_down")