From e0613bba79bb01cf0c385775811867c63e137ddc Mon Sep 17 00:00:00 2001 From: Shane Grey Date: Tue, 6 Dec 2016 16:24:52 -0600 Subject: [PATCH 1/2] Change from deprecated field.related to field.remote_field Removes deprecation warning. --- report_builder/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/report_builder/utils.py b/report_builder/utils.py index 2f5b67af..0889fccb 100644 --- a/report_builder/utils.py +++ b/report_builder/utils.py @@ -201,12 +201,12 @@ def get_model_from_path_string(root_model, path): if direct: if hasattr(field, 'related'): try: - root_model = field.related.parent_model() + root_model = field.remote_field.parent_model() except AttributeError: - root_model = field.related.model + root_model = field.remote_field.model else: if hasattr(field, 'related_model'): - root_model = field.related_model + root_model = field.remote_field_model else: root_model = field.model return root_model From c95ff9de72f966d3330ae8ffb49a4a9095bd0f5d Mon Sep 17 00:00:00 2001 From: Shane Grey Date: Tue, 6 Dec 2016 16:36:00 -0600 Subject: [PATCH 2/2] Change deprecated field.related to field.remote_field --- report_builder/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/report_builder/utils.py b/report_builder/utils.py index 0889fccb..b7c7314a 100644 --- a/report_builder/utils.py +++ b/report_builder/utils.py @@ -199,14 +199,14 @@ def get_model_from_path_string(root_model, path): except FieldDoesNotExist: return root_model if direct: - if hasattr(field, 'related'): + if hasattr(field, 'remote_field'): try: root_model = field.remote_field.parent_model() except AttributeError: root_model = field.remote_field.model else: if hasattr(field, 'related_model'): - root_model = field.remote_field_model + root_model = field.related_model else: root_model = field.model return root_model