Skip to content

Commit

Permalink
Calculo los indicadores no indexables accediendo a la base de datos
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslavandeira committed Mar 26, 2018
1 parent 4c32fb7 commit 2782169
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions series_tiempo_ar_api/libs/indexing/report/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def calculate_series_indicators(self, node, data_json):
distribution__dataset__indexable=True).count()
self.task.indicator_set.create(type=Indicator.FIELD_INDEXABLE, value=indexable, node=node)

not_indexable = total - indexable
not_indexable = Field.objects.filter(distribution__dataset__catalog=catalog,
distribution__dataset__indexable=False,
distribution__dataset__present=True).count()
self.task.indicator_set.create(type=Indicator.FIELD_NOT_INDEXABLE, value=not_indexable, node=node)
updated = self.task.indicator_set.get_or_create(type=Indicator.FIELD_UPDATED, node=node)[0].value

Expand All @@ -143,7 +145,9 @@ def calculate_distribution_indicators(self, node, data_json):
indexable = Distribution.objects.filter(dataset__catalog=catalog,
dataset__indexable=True).count()
self.task.indicator_set.create(type=Indicator.DISTRIBUTION_INDEXABLE, value=indexable, node=node)
not_indexable = total - indexable
not_indexable = Distribution.objects.filter(dataset__catalog=catalog,
dataset__indexable=False,
dataset__present=True).count()
self.task.indicator_set.create(type=Indicator.DISTRIBUTION_NOT_INDEXABLE, value=not_indexable, node=node)

updated = self.task.indicator_set.get_or_create(type=Indicator.DISTRIBUTION_UPDATED, node=node)[0].value
Expand Down

0 comments on commit 2782169

Please sign in to comment.