-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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)
# ...
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #210, Closes #197
Calculo los indicadores de catálogo durante la generación de reporte (y los uso!)