當前位置: 首頁>>代碼示例>>Python>>正文


Python ActionInformation.ActionInformation類代碼示例

本文整理匯總了Python中Products.CMFCore.ActionInformation.ActionInformation的典型用法代碼示例。如果您正苦於以下問題:Python ActionInformation類的具體用法?Python ActionInformation怎麽用?Python ActionInformation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ActionInformation類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_Condition

 def test_Condition(self):
     portal = self.portal 
     folder = self.folder
     object = self.object 
     ai = ActionInformation(id='view'
                          , title='View'
                          , action=Expression(
          text='view')
                          , condition=Expression(
          text='member')
                          , category='global'
                          , visible=1)
     ec = createExprContext(folder, portal, object)
     self.failIf(ai.testCondition(ec))
開發者ID:goschtl,項目名稱:zope,代碼行數:14,代碼來源:test_ActionInformation.py

示例2: test_editing

 def test_editing(self):
     ai = ActionInformation(id='view',
                            category='folder',
                           )
     ai.edit(id='new_id', title='blah')
     self.assertEqual(ai.getId(), 'new_id')
     self.assertEqual(ai.Title(), 'blah')
     self.assertEqual(ai.Description(), '')
     self.assertEqual(ai.getCondition(), '')
     self.assertEqual(ai.getActionExpression(), '')
     self.assertEqual(ai.getVisibility(), 1)
     self.assertEqual(ai.getCategory(), 'folder')
     self.assertEqual(ai.getPermissions(), ())
開發者ID:goschtl,項目名稱:zope,代碼行數:13,代碼來源:test_ActionInformation.py

示例3: test_basic_construction

 def test_basic_construction(self):
     ai = ActionInformation(id='view'
                           )
     self.assertEqual(ai.getId(), 'view')
     self.assertEqual(ai.Title(), 'view')
     self.assertEqual(ai.Description(), '')
     self.assertEqual(ai.getCondition(), '')
     self.assertEqual(ai.getActionExpression(), '')
     self.assertEqual(ai.getVisibility(), 1)
     self.assertEqual(ai.getCategory(), 'object')
     self.assertEqual(ai.getPermissions(), ())
開發者ID:goschtl,項目名稱:zope,代碼行數:11,代碼來源:test_ActionInformation.py

示例4: _importOldAction

    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,代碼行數:24,代碼來源:ERP5Type.py

示例5: _importOldAction

    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,代碼行數:24,代碼來源:ERP5Type.py

示例6: test_construction_with_Expressions

 def test_construction_with_Expressions(self):
     ai = ActionInformation(id='view'
                          , title='View'
                          , action=Expression(
          text='view')
                          , condition=Expression(
          text='member')
                          , category='global'
                          , visible=0)
     self.assertEqual(ai.getId(), 'view')
     self.assertEqual(ai.Title(), 'View')
     self.assertEqual(ai.Description(), '')
     self.assertEqual(ai.getCondition(), 'member')
     self.assertEqual(ai.getActionExpression(), 'string:view')
     self.assertEqual(ai.getVisibility(), 0)
     self.assertEqual(ai.getCategory(), 'global')
     self.assertEqual(ai.getPermissions(), ())
開發者ID:goschtl,項目名稱:zope,代碼行數:17,代碼來源:test_ActionInformation.py

示例7: getAction

 def getAction(self, ec):
     res = ActionInformation.getAction(self, ec)
     res['description'] = self.getDescription()
     return res
開發者ID:erral,項目名稱:Products.CMFPlone,代碼行數:4,代碼來源:PloneControlPanel.py

示例8: __init__

 def __init__(self, appId, **kwargs):
     self.appId = appId
     ActionInformation.__init__(self, **kwargs)
開發者ID:erral,項目名稱:Products.CMFPlone,代碼行數:3,代碼來源:PloneControlPanel.py


注:本文中的Products.CMFCore.ActionInformation.ActionInformation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。