本文整理汇总了Python中Products.CMFCore.ActionInformation.ActionInformation.uid方法的典型用法代码示例。如果您正苦于以下问题:Python ActionInformation.uid方法的具体用法?Python ActionInformation.uid怎么用?Python ActionInformation.uid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.CMFCore.ActionInformation.ActionInformation
的用法示例。
在下文中一共展示了ActionInformation.uid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _importOldAction
# 需要导入模块: from Products.CMFCore.ActionInformation import ActionInformation [as 别名]
# 或者: from Products.CMFCore.ActionInformation.ActionInformation import uid [as 别名]
def _importOldAction(self, old_action):
"""Convert a CMF action to an ERP5 action
This is used to update an existing site or to import a BT.
"""
import erp5.portal_type
ActionInformation = getattr(erp5.portal_type, 'Action Information')
old_action = old_action.__getstate__()
action_type = old_action.pop('category', None)
action = ActionInformation(self.generateNewId())
for k, v in old_action.iteritems():
if k in ('action', 'condition', 'icon'):
if not v:
continue
v = v.__class__(v.text)
setattr(action, {'id': 'reference',
'priority': 'float_index',
'permissions': 'action_permission',
}.get(k, k), v)
action.uid = None
action = self[self._setObject(action.id, action, set_owner=0)]
if action_type:
action._setCategoryMembership('action_type', action_type)
return action
示例2: _importOldAction
# 需要导入模块: from Products.CMFCore.ActionInformation import ActionInformation [as 别名]
# 或者: from Products.CMFCore.ActionInformation.ActionInformation import uid [as 别名]
def _importOldAction(self, old_action):
"""Convert a CMF action to an ERP5 action
This is used to update an existing site or to import a BT.
"""
import erp5.portal_type
ActionInformation = getattr(erp5.portal_type, "Action Information")
old_action = old_action.__getstate__()
action_type = old_action.pop("category", None)
action = ActionInformation(self.generateNewId())
for k, v in old_action.iteritems():
if k in ("action", "condition", "icon"):
if not v:
continue
v = v.__class__(v.text)
setattr(
action, {"id": "reference", "priority": "float_index", "permissions": "action_permission"}.get(k, k), v
)
action.uid = None
action = self[self._setObject(action.id, action, set_owner=0)]
if action_type:
action._setCategoryMembership("action_type", action_type)
return action