From c0a93d39411004300dfda2deb3dc093b69ac6368 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 18 Nov 2022 14:47:29 +0100 Subject: [PATCH] Removed unnecessary ForeignKey.get_reverse_path_info(). get_reverse_path_info() is already inherited from ForeignObject. --- django/db/models/fields/related.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index c763f555e3..11074de9eb 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -1060,22 +1060,6 @@ class ForeignKey(ForeignObject): def target_field(self): return self.foreign_related_fields[0] - def get_reverse_path_info(self, filtered_relation=None): - """Get path from the related model to this field's model.""" - opts = self.model._meta - from_opts = self.remote_field.model._meta - return [ - PathInfo( - from_opts=from_opts, - to_opts=opts, - target_fields=(opts.pk,), - join_field=self.remote_field, - m2m=not self.unique, - direct=False, - filtered_relation=filtered_relation, - ) - ] - def validate(self, value, model_instance): if self.remote_field.parent_link: return