当前位置: 首页>>代码示例>>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;未经允许,请勿转载。