本文整理匯總了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")