From 0258ce760b6be944f03261921fc5d63e713fa01c Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Sat, 4 May 2024 22:37:35 -0300 Subject: [PATCH] Add Quartlie count to Symbols list --- base/templates/base/home.html | 4 ++++ base/views.py | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/base/templates/base/home.html b/base/templates/base/home.html index 1e91570..2cc92ee 100644 --- a/base/templates/base/home.html +++ b/base/templates/base/home.html @@ -48,6 +48,10 @@
{% indicators_radio_buttons %} +
+ {{ quartiles }} +
+
{% for symbol in symbols %} {% symbol_render_html_snippet symbol=symbol %} diff --git a/base/views.py b/base/views.py index a7bce5a..bcf93d4 100644 --- a/base/views.py +++ b/base/views.py @@ -1,4 +1,5 @@ import inspect +from collections import Counter from django.conf import settings from django.contrib import messages @@ -37,6 +38,12 @@ def get_context_data(self, **kwargs): context["symbols"] = Symbol.objects.top_symbols() context["time_interval"] = settings.TIME_INTERVAL context["ms_threshold"] = settings.MODEL_SCORE_THRESHOLD + context["quartiles"] = Counter( + [ + s.others["describe"]["current_quartile"] + for s in context["symbols"] + ] + ) return context