diff --git a/series_tiempo_ar_api/libs/indexing/report/indicators_generator.py b/series_tiempo_ar_api/libs/indexing/report/indicators_generator.py index 14ea6222..e72728b4 100644 --- a/series_tiempo_ar_api/libs/indexing/report/indicators_generator.py +++ b/series_tiempo_ar_api/libs/indexing/report/indicators_generator.py @@ -74,7 +74,8 @@ def calculate_dataset_indicators(self, node, data_json): available = len(data_json.get_datasets(only_time_series=True)) self.create(type=Indicator.DATASET_AVAILABLE, value=available, node=node) - total = Field.objects.values_list('distribution__dataset').distinct().count() + total = Field.objects.filter(distribution__dataset__catalog=catalog)\ + .values_list('distribution__dataset').distinct().count() self.create(type=Indicator.DATASET_TOTAL, value=total, node=node) def calculate_distribution_indicators(self, node, data_json): @@ -118,7 +119,8 @@ def calculate_distribution_indicators(self, node, data_json): node=node) self.create(type=Indicator.DISTRIBUTION_TOTAL, - value=Field.objects.values_list('distribution').distinct().count(), + value=Field.objects.filter(distribution__dataset__catalog=catalog). + values_list('distribution').distinct().count(), node=node) def calculate_series_indicators(self, node, data_json): @@ -164,4 +166,6 @@ def calculate_series_indicators(self, node, data_json): value=len(data_json.get_fields(only_time_series=True)), node=node) - self.create(type=Indicator.FIELD_TOTAL, value=Field.objects.count(), node=node) + self.create(type=Indicator.FIELD_TOTAL, + value=Field.objects.filter(distribution__dataset__catalog=catalog).count(), + node=node)