Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change from deprecated field.related to field.remote_field #253

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions report_builder/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ 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.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
Expand Down