def getQueryAnchor(self, context, metatype=None): """Gets the containg parent of context, if it is an ExtropyBase object, or the first on that is. """ for o in list(context.aq_chain): if IExtropyTracking.providedBy(o): if metatype is None: return o elif hasattr(o,'meta_type') and metatype == o.meta_type: return o return getToolByName(self, 'portal_url').getPortalObject()
def testProjectInterface(self): from Products.Extropy.interfaces import IExtropyBase self.failUnless(IExtropyBase.providedBy(self.project)) from Products.Extropy.interfaces import IExtropyTracking self.failUnless(IExtropyTracking.providedBy(self.project))