def setFormula(self, Formula=None):
        """Set the Dependent Services from the text of the calculation Formula
        """
        bsc = getToolByName(self, 'bika_setup_catalog')
        if Formula is None:
            self.setDependentServices(None)
            self.getField('Formula').set(self, Formula)
        else:
            keywords = re.compile(r"\[([^.^\]]+)\]").findall(Formula)
            brains = bsc(portal_type='AnalysisService',
                         getKeyword=keywords)
            services = [brain.getObject() for brain in brains]
            self.getField('DependentServices').set(self, services)
            self.getField('Formula').set(self, Formula)
def setFormula ( self , Formula = None ) : bsc = getToolByName ( self , 'bika_setup_catalog' ) if Formula is None : self . setDependentServices ( None ) self . getField ( 'Formula' ) . set ( self , Formula ) else : keywords = re . compile ( r"\[([^.^\]]+)\]" ) . findall ( Formula ) brains = bsc ( portal_type = 'AnalysisService' , getKeyword = keywords ) services = [ brain . getObject ( ) for brain in brains ] self . getField ( 'DependentServices' ) . set ( self , services ) self . getField ( 'Formula' ) . set ( self , Formula )
Set the Dependent Services from the text of the calculation Formula