- {% for item in meta %}
-
+ {% for key,items in meta.items %}
+
- {% if 'ts' in item %}
+ {% for item in items %}
-
{% endfor %} diff --git a/core/views/dynamic/insights.py b/core/views/dynamic/insights.py index 972d74d..a177329 100644 --- a/core/views/dynamic/insights.py +++ b/core/views/dynamic/insights.py @@ -107,16 +107,15 @@ class InsightsMeta(LoginRequiredMixin, APIView): if k in ["ts", "time", "date", "id"]: continue unique_values[nick][k].add(v) - meta_dedup = [] + meta_dedup = {} for x in meta: nick = x["nick"] - meta_l2 = {} for k, v in x.items(): if v in unique_values[nick][k]: - meta_l2[k] = v + if k not in meta_dedup: + meta_dedup[k] = set() + meta_dedup[k].add(v) unique_values[nick][k].remove(v) - if not set(meta_l2.keys()).issubset(set(["ts", "time", "date", "id"])): - meta_dedup.append(meta_l2) context = {"net": net, "nicks": nicks, "meta": meta_dedup} return render(request, self.template_name, context)
{{ key }} | +
---|
ts |
- {{ item.date }} -{{ item.time }} + {{ item }} |
---|---|
nick | -{{ item.nick }} | -
ident | -{{ item.ident }} | -
host | -{{ item.host }} | -
realname | -{{ item.realname }} | -
status | -{{ item.status }} | -
server | -{{ item.server }} | -
channel | -{{ item.channel }} | -
{% endfor %} diff --git a/core/views/dynamic/insights.py b/core/views/dynamic/insights.py index 972d74d..a177329 100644 --- a/core/views/dynamic/insights.py +++ b/core/views/dynamic/insights.py @@ -107,16 +107,15 @@ class InsightsMeta(LoginRequiredMixin, APIView): if k in ["ts", "time", "date", "id"]: continue unique_values[nick][k].add(v) - meta_dedup = [] + meta_dedup = {} for x in meta: nick = x["nick"] - meta_l2 = {} for k, v in x.items(): if v in unique_values[nick][k]: - meta_l2[k] = v + if k not in meta_dedup: + meta_dedup[k] = set() + meta_dedup[k].add(v) unique_values[nick][k].remove(v) - if not set(meta_l2.keys()).issubset(set(["ts", "time", "date", "id"])): - meta_dedup.append(meta_l2) context = {"net": net, "nicks": nicks, "meta": meta_dedup} return render(request, self.template_name, context)