From 300e9b062e5cadd33ac75f2432c1734440078543 Mon Sep 17 00:00:00 2001 From: Jerome Leclanche Date: Fri, 19 May 2017 10:16:51 +0300 Subject: [PATCH] Use field.remote_field instead of field.rel Deprecated in Django 1.9, removed in 2.0 More information: - https://docs.djangoproject.com/en/1.11/releases/1.9/#field-rel-changes --- polymorphic/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polymorphic/models.py b/polymorphic/models.py index a066371..6c7a9b4 100644 --- a/polymorphic/models.py +++ b/polymorphic/models.py @@ -218,7 +218,7 @@ class PolymorphicModel(six.with_metaclass(PolymorphicModelBase, models.Model)): if super_cls in sub_cls._meta.parents: # super_cls may not be in sub_cls._meta.parents if super_cls is a proxy model field_to_super = sub_cls._meta.parents[super_cls] # get the field that links sub_cls to super_cls if field_to_super is not None: # if filed_to_super is not a link to a proxy model - super_to_sub_related_field = field_to_super.rel + super_to_sub_related_field = field_to_super.remote_field if super_to_sub_related_field.related_name is None: # if related name is None the related field is the name of the subclass to_subclass_fieldname = sub_cls.__name__.lower()