3👍
✅
From older Django version source code
def to(self): warnings.warn( "Usage of ForeignObjectRel.to attribute has been deprecated. " "Use the model attribute instead.", RemovedInDjango20Warning, 2) return self.model
so change
remote_field = rel.to
to
remote_field = rel.model
Source:stackexchange.com