1
0
mirror of https://github.com/django/django.git synced 2025-01-03 06:55:47 +00:00

Removed unnecessary ForeignKey.get_reverse_path_info().

get_reverse_path_info() is already inherited from ForeignObject.
This commit is contained in:
Mariusz Felisiak 2022-11-18 14:47:29 +01:00 committed by GitHub
parent 25904db915
commit c0a93d3941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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