Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

210 catalog indicators #229

Merged
merged 3 commits into from
Mar 20, 2018
Merged

210 catalog indicators #229

merged 3 commits into from
Mar 20, 2018

Conversation

lucaslavandeira
Copy link
Contributor

@lucaslavandeira lucaslavandeira commented Mar 20, 2018

Closes #210, Closes #197

Calculo los indicadores de catálogo durante la generación de reporte (y los uso!)

@coveralls
Copy link

coveralls commented Mar 20, 2018

Coverage Status

Coverage decreased (-0.02%) to 82.986% when pulling 777b306 on 210-catalog-indicators into 1165da9 on master.

@@ -113,9 +110,17 @@ def _get_indicator_value(self, indicator_type):

def calculate_indicators(self):
for node in Node.objects.filter(indexable=True):
self.task.indicator_set.create(type=Indicator.CATALOG_TOTAL, value=1, node=node)

catalog_model = Catalog.objects.filter(identifier=node.catalog_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodes = Node.objects.filter(indexable=True)
catalog_ids = nodes.values_list('catalog_id', flat=True)
for catalog_model in Catalog.objects.filter(identifier__in=catalog_ids):
    node = nodes.get(catalog_id=catalog_model.identifier)
    # ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sin "if"s.
No sé si es mejor, me gusta. :)
Esta permitido ignorar este comment.
😉


updated = catalog_model.updated
self.task.indicator_set.create(type=Indicator.CATALOG_UPDATED, value=updated, node=node)
not_updated = 1 - updated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucaslavandeira lucaslavandeira merged commit 668f59d into master Mar 20, 2018
@lucaslavandeira lucaslavandeira deleted the 210-catalog-indicators branch April 11, 2018 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants