本文整理汇总了Python中OFS.Folder.Folder._properties方法的典型用法代码示例。如果您正苦于以下问题:Python Folder._properties方法的具体用法?Python Folder._properties怎么用?Python Folder._properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OFS.Folder.Folder
的用法示例。
在下文中一共展示了Folder._properties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _createZODBClone
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _properties [as 别名]
def _createZODBClone(self):
"""Create a ZODB (editable) equivalent of this object."""
# Create a Folder to hold the properties.
obj = Folder()
obj.id = self.getId()
map = []
for p in self._properties:
# This should be secure since the properties come
# from the filesystem.
setattr(obj, p['id'], getattr(self, p['id']))
map.append({'id': p['id'],
'type': p['type'],
'mode': 'wd',})
obj._properties = tuple(map)
return obj
示例2: manage_doCustomize
# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import _properties [as 别名]
def manage_doCustomize(self, folder_path, RESPONSE=None):
'''
Makes a Folder with the same properties.
'''
custFolder = self.getCustomizableObject()
fpath = tuple(split(folder_path, '/'))
folder = self.restrictedTraverse(fpath)
id = self.getId()
obj = Folder(id)
map = []
for p in self._properties:
# This should be secure since the properties come
# from the filesystem.
setattr(obj, p['id'], getattr(self, p['id']))
map.append({'id': p['id'],
'type': p['type'],
'mode': 'wd',})
obj._properties = tuple(map)
obj.id = id
folder._verifyObjectPaste(obj, validate_src=0)
folder._setObject(id, obj)
if RESPONSE is not None:
RESPONSE.redirect('%s/%s/manage_propertiesForm' % (
folder.absolute_url(), id))