本文整理匯總了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
示例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
示例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))
示例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))
示例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))
示例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))
示例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)
示例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))
示例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))
示例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))
示例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))
示例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))
示例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))
示例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))