1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Simplified ForeignObject.resolve_related_fields() a bit.

This commit is contained in:
Lily Foote 2023-09-19 04:25:35 +01:00 committed by GitHub
parent eeb5c583f7
commit 23df37d53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -714,9 +714,7 @@ class ForeignObject(RelatedField):
"Related model %r cannot be resolved" % self.remote_field.model
)
related_fields = []
for index in range(len(self.from_fields)):
from_field_name = self.from_fields[index]
to_field_name = self.to_fields[index]
for from_field_name, to_field_name in zip(self.from_fields, self.to_fields):
from_field = (
self
if from_field_name == RECURSIVE_RELATIONSHIP_CONSTANT