From ec2fc0e18a490634a2da97a16ac94725c3acdc32 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 16 Sep 2021 10:29:22 +0200 Subject: Migration to Django 2.2 - fixes - rel -> remote_field - to -> model - default initialization for historical models --- ishtar_common/widgets.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index e444261d9..ddc4eb913 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -1223,8 +1223,8 @@ class DataTable(Select2Media, forms.RadioSelect): if "." in col_name: keys = col_name.split(".") for key in keys: - if hasattr(field, "rel") and field.rel: - field = field.rel.to + if hasattr(field, "remote_field") and field.remote_field: + field = field.remote_field.model try: field = field._meta.get_field(key) field_verbose_name = field.verbose_name -- cgit v1.2.3