Exemplo n.º 1
0
 def links(self):
     """Named links for context, if applicable"""
     result = []
     _get = lambda uid: uuidToCatalogBrain(uid)
     if IMeasureSeriesProvider.providedBy(self.context):
         measure_uid = self.context.measure
         dataset_uid = self.context.dataset
         if measure_uid:
             brain = _get(measure_uid)
             if brain:
                 result.append(
                     ('Measure: %s' % brain.Title, brain.getURL()))
         if dataset_uid:
             brain = _get(dataset_uid)
             if brain:
                 result.append(
                     ('Data set: %s' % brain.Title, brain.getURL()))
     return result
Exemplo n.º 2
0
 def links(self):
     """Named links for context, if applicable"""
     result = []
     _get = lambda uid: uuidToCatalogBrain(uid)
     if IMeasureSeriesProvider.providedBy(self.context):
         measure_uid = self.context.measure
         dataset_uid = self.context.dataset
         if measure_uid:
             brain = _get(measure_uid)
             if brain:
                 result.append((
                     'Measure: %s' % brain.Title,
                     brain.getURL()
                     ))
         if dataset_uid:
             brain = _get(dataset_uid)
             if brain:
                 result.append((
                     'Data set: %s' % brain.Title,
                     brain.getURL()
                     ))
     return result
Exemplo n.º 3
0
 def strategy(self):
     """Summarization strategy, if applicable"""
     if IMeasureSeriesProvider.providedBy(self.context):
         strategy = self.context.summarization_strategy or 'AVG'
         return STRATEGIES.get(strategy)  # label
     return None
Exemplo n.º 4
0
 def strategy(self):
     """Summarization strategy, if applicable"""
     if IMeasureSeriesProvider.providedBy(self.context):
         strategy = self.context.summarization_strategy or 'AVG'
         return STRATEGIES.get(strategy)  # label
     return None