def compilationUID(obj):
    previousparent = parent = obj.aq_parent
    while ICompilation.providedBy(parent) or ISection.providedBy(parent):
        previousparent = parent
        parent = parent.aq_parent
    uuid = IUUID(previousparent)
    return uuid
Beispiel #2
0
def compilationUID(obj):
    previousparent = parent = obj.aq_parent
    while ICompilation.providedBy(parent) or ISection.providedBy(parent):
        previousparent = parent
        parent = parent.aq_parent
    uuid = IUUID(previousparent)
    return uuid
    def getCompilation(self, request=None):
        if ICompilation.providedBy(self.context): return self.context

        request = request or self.request
        compilationuid = request.get('compilationuid', None)
        if compilationuid is None:
            return
        pc = getToolByName(self.context, 'portal_catalog')
        brains = pc(UID=compilationuid)
        return brains and brains[0].getObject() or None
 def test_isCompilation(self):
     compilation = self.portal._getOb('compilation001')
     self.assertTrue(ICompilation.providedBy(compilation))
 def test_isCompilation(self):
     compilation = self.portal._getOb('compilation001')
     self.assertTrue(ICompilation.providedBy(compilation))
 def isCompilation(self, context=None):
     context = context or self.context
     return ICompilation.providedBy(context)