From 171cbc754a1b29ed87107fc7a6020819617383f8 Mon Sep 17 00:00:00 2001 From: Kevin Stadler Date: Wed, 7 Apr 2021 13:48:57 +0800 Subject: [PATCH] Add Application.active_view_filters(). --- vit/application.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vit/application.py b/vit/application.py index 8c08094..407cb3a 100644 --- a/vit/application.py +++ b/vit/application.py @@ -103,6 +103,10 @@ def set_active_context(self): def active_context_filter(self): return self.contexts[self.context]['filter'] if self.context and self.reports[self.report].get('context', 1) else [] + def active_view_filters(self): + # precedence-preserving concatenation of context, report and extra filters + return self.model.build_task_filters(self.active_context_filter(), self.model.active_report_filter(), self.extra_filters) + def load_contexts(self): self.contexts = self.task_config.get_contexts()