当前位置: 首页>>代码示例>>Python>>正文


Python ActionInformation.uid方法代码示例

本文整理汇总了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
开发者ID:ccwalkerjm,项目名称:erp5,代码行数:26,代码来源:ERP5Type.py

示例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
开发者ID:Provab-Solutions,项目名称:erp5,代码行数:26,代码来源:ERP5Type.py


注:本文中的Products.CMFCore.ActionInformation.ActionInformation.uid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。