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


Python IReferenceable.providedBy方法代碼示例

本文整理匯總了Python中plone.app.referenceablebehavior.referenceable.IReferenceable.providedBy方法的典型用法代碼示例。如果您正苦於以下問題:Python IReferenceable.providedBy方法的具體用法?Python IReferenceable.providedBy怎麽用?Python IReferenceable.providedBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在plone.app.referenceablebehavior.referenceable.IReferenceable的用法示例。


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

示例1: transmogrify

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
    def transmogrify(self, item):
        path = self.get_path(item)
        obj = self.get_object(item)

        uid = item.get(self.uidkey, "")
        if not uid:
            raise NothingToDoHere

        at_uid = ATIReferenceable.providedBy(obj)
        dx_uid = DXIReferenceable.providedBy(obj)

        old_uid = obj.UID()
        if old_uid != uid:
            # Code from plone.app.transmogrifier used for AT objects:
            if at_uid:
                if not old_uid:
                    setattr(obj, AT_UUID_ATTR, uid)
                else:
                    obj._setUID(uid)
            elif dx_uid:
                setattr(obj, DX_UID_ATTR, uid)
            else: #Don't ask, JUST DO IT!
                  # If the attribute is not used as UID, it
                  # is not used as anything else as well,
                  # and at least the desired UID value stays recorded in the
                  # object, allowing for a post-migration retrieval
                setattr(obj, DEFAULT_UID_ATTR, uid)
        return item
開發者ID:simplesconsultoria,項目名稱:sc.transmogrifier,代碼行數:30,代碼來源:universal_uid_updater.py

示例2: update

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
    def update(self):
        catalog = getToolByName(self.context, 'portal_catalog')
        count = 0
        kwargs = {}

        if HAS_LINGUAPLONE or HAS_PAM:
            kwargs['Language'] = 'all'

        for brain in catalog(**kwargs):
            obj = brain.getObject()
            if IBaseObject.providedBy(obj):
                modifiedArchetype(obj, 'dummy event parameter')
                count += 1
            elif IDexterityContent.providedBy(obj):
                if IReferenceable.providedBy(obj):
                    modifiedDexterity(obj, 'dummy event parameter')
                count += 1
        return count
開發者ID:urska19,項目名稱:Plone-test,代碼行數:20,代碼來源:update.py

示例3: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.assertTrue(IReferenceable.providedBy(self.office))
     self.assertTrue(IAttributeUUID.providedBy(self.office))
開發者ID:hersonrodrigues,項目名稱:interlegis.portalmodelo.ombudsman,代碼行數:5,代碼來源:test_ombudsoffice.py

示例4: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.folder.invokeFactory("telesur.contenttypes.program", "p1")
     p1 = self.folder["p1"]
     self.assertTrue(IReferenceable.providedBy(p1))
     self.assertTrue(IAttributeUUID.providedBy(p1))
開發者ID:teleSUR,項目名稱:telesur.contenttypes,代碼行數:7,代碼來源:test_program.py

示例5: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.folder.invokeFactory('collective.nitf.content', 'n1')
     n1 = self.folder['n1']
     self.assertTrue(IReferenceable.providedBy(n1))
     self.assertTrue(IAttributeUUID.providedBy(n1))
開發者ID:flecox,項目名稱:collective.nitf,代碼行數:7,代碼來源:test_content.py

示例6: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.assertTrue(IReferenceable.providedBy(self.compromisso))
     self.assertTrue(IAttributeUUID.providedBy(self.compromisso))
開發者ID:brunobbbs,項目名稱:brasil.gov.agenda,代碼行數:5,代碼來源:test_compromisso.py

示例7: referencedObjectRemoved

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
def referencedObjectRemoved(obj, event):
    if not IReferenceable.providedBy(obj):
        baseReferencedObjectRemoved(obj, event)
開發者ID:collective,項目名稱:collective.contact.plonegroup,代碼行數:5,代碼來源:subscribers.py

示例8: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.assertTrue(IReferenceable.providedBy(self.parliamentarian))
     self.assertTrue(IAttributeUUID.providedBy(self.parliamentarian))
開發者ID:interlegis,項目名稱:interlegis.portalmodelo.pl,代碼行數:5,代碼來源:test_parliamentarian.py

示例9: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.assertTrue(IReferenceable.providedBy(self.department))
     self.assertTrue(IAttributeUUID.providedBy(self.department))
開發者ID:interlegis,項目名稱:interlegis.intranetmodelo.departments,代碼行數:5,代碼來源:test_content.py

示例10: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.assertTrue(IReferenceable.providedBy(self.agendadiaria))
     self.assertTrue(IAttributeUUID.providedBy(self.agendadiaria))
開發者ID:plonegovbr,項目名稱:brasil.gov.agenda,代碼行數:5,代碼來源:test_agendadiaria.py

示例11: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.registrations.invokeFactory('conference.registration',
                                      'guido')
     registration = self.registrations['guido']
     self.assertTrue(IReferenceable.providedBy(registration))
     self.assertTrue(IAttributeUUID.providedBy(registration))
開發者ID:plonegovbr,項目名稱:conference.registration,代碼行數:8,代碼來源:test_registration.py

示例12: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     p1 = self.p1
     self.assertTrue(IReferenceable.providedBy(p1))
     self.assertTrue(IAttributeUUID.providedBy(p1))
開發者ID:simplesconsultoria,項目名稱:s17.person,代碼行數:6,代碼來源:test_content.py

示例13: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.folder.invokeFactory('Employee', 'e1')
     e1 = self.folder['e1']
     self.assertTrue(IAttributeUUID.providedBy(e1))
     self.assertTrue(IReferenceable.providedBy(e1))
開發者ID:simplesconsultoria,項目名稱:s17.employee,代碼行數:7,代碼來源:test_content.py

示例14: test_is_referenceable

# 需要導入模塊: from plone.app.referenceablebehavior.referenceable import IReferenceable [as 別名]
# 或者: from plone.app.referenceablebehavior.referenceable.IReferenceable import providedBy [as 別名]
 def test_is_referenceable(self):
     self.members.invokeFactory('conference.profile', 'guido')
     profile = self.members['guido']
     self.assertTrue(IReferenceable.providedBy(profile))
     self.assertTrue(IAttributeUUID.providedBy(profile))
開發者ID:plonegovbr,項目名稱:conference.profile,代碼行數:7,代碼來源:test_profile.py


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