From 37afc669137fca12c29b1e1ea21e5a40461fbf42 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 13 Aug 2020 15:19:06 +0200 Subject: [PATCH] chg: [correlation] basic correlation: get_correlation_all_object function --- bin/lib/simple_correlation.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/lib/simple_correlation.py b/bin/lib/simple_correlation.py index 8f215c23..254b19eb 100755 --- a/bin/lib/simple_correlation.py +++ b/bin/lib/simple_correlation.py @@ -166,20 +166,20 @@ class SimpleCorrelation(object): #social_name else: return [] - # def get_correlation_all_object(self, correlation_type, correlation_value, correlation_objects=[]): - # if not correlation_objects: - # correlation_objects = get_all_correlation_objects() - # correlation_obj = {} - # for correlation_object in correlation_objects: - # if correlation_object == 'paste': - # res = self._get_items(correlation_type, correlation_value) - # elif correlation_object == 'domain': - # res = self.get_correlation_obj_domain(correlation_value, correlation_type=correlation_type) - # else: - # res = None - # if res: - # correlation_obj[correlation_object] = res - # return correlation_obj + def get_correlation_all_object(self, correlation_value, correlation_objects=[]): + if not correlation_objects: + correlation_objects = get_all_correlation_objects() + correlation_obj = {} + for correlation_object in correlation_objects: + if correlation_object == 'paste': + res = self._get_items(correlation_value) + elif correlation_object == 'domain': + res = self.get_correlation_obj_domain(correlation_value) + else: + res = None + if res: + correlation_obj[correlation_object] = res + return correlation_obj def update_correlation_daterange(self, obj_id, date): date = int(date)