From 1fd6a8c422595c8ec99f5ac4c8728bc39e438b0b Mon Sep 17 00:00:00 2001 From: Aron Nochenson Date: Thu, 10 Sep 2020 21:20:48 +0300 Subject: [PATCH] put in way for objects to show their own tree --- gdpr_assist/admin/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdpr_assist/admin/base.py b/gdpr_assist/admin/base.py index cb557bf..f783f5f 100644 --- a/gdpr_assist/admin/base.py +++ b/gdpr_assist/admin/base.py @@ -117,6 +117,10 @@ def anonymise_view(self, request): tree_html = "" tree = self.model.get_anonymisation_tree(objs=objects).replace(" [set_field]", "").replace(" [fk]", "") + + if hasattr(objects.first(), 'get_anonymisation_tree_for_obj'): + tree = "\n".join([o.get_anonymisation_tree_for_obj() for o in objects]) + this_html = "{model_name}:\n{tree}\n\n".format(model_name=self.model.__name__, tree=tree) if self.model.__name__ != "RetentionPolicyItem": this_html = "
{html}
".format(html=this_html)