本文整理汇总了Python中plone.app.referenceablebehavior.referenceable.IReferenceable类的典型用法代码示例。如果您正苦于以下问题:Python IReferenceable类的具体用法?Python IReferenceable怎么用?Python IReferenceable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IReferenceable类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: transmogrify
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
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
def test_is_referenceable(self):
self.assertTrue(IReferenceable.providedBy(self.office))
self.assertTrue(IAttributeUUID.providedBy(self.office))
示例4: test_is_referenceable
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
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
def test_is_referenceable(self):
self.assertTrue(IReferenceable.providedBy(self.compromisso))
self.assertTrue(IAttributeUUID.providedBy(self.compromisso))
示例7: referencedObjectRemoved
def referencedObjectRemoved(obj, event):
if not IReferenceable.providedBy(obj):
baseReferencedObjectRemoved(obj, event)
示例8: test_is_referenceable
def test_is_referenceable(self):
self.assertTrue(IReferenceable.providedBy(self.parliamentarian))
self.assertTrue(IAttributeUUID.providedBy(self.parliamentarian))
示例9: test_is_referenceable
def test_is_referenceable(self):
self.assertTrue(IReferenceable.providedBy(self.department))
self.assertTrue(IAttributeUUID.providedBy(self.department))
示例10: test_is_referenceable
def test_is_referenceable(self):
self.assertTrue(IReferenceable.providedBy(self.agendadiaria))
self.assertTrue(IAttributeUUID.providedBy(self.agendadiaria))
示例11: test_is_referenceable
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
def test_is_referenceable(self):
p1 = self.p1
self.assertTrue(IReferenceable.providedBy(p1))
self.assertTrue(IAttributeUUID.providedBy(p1))
示例13: test_is_referenceable
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
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))