mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #30368 -- Fixed prefetch_related() for GenericForeignKey when PK is also a FK.
This commit is contained in:
committed by
Mariusz Felisiak
parent
d610521bff
commit
a4055adf70
@@ -939,6 +939,9 @@ class ForeignKey(ForeignObject):
|
||||
def get_db_prep_value(self, value, connection, prepared=False):
|
||||
return self.target_field.get_db_prep_value(value, connection, prepared)
|
||||
|
||||
def get_prep_value(self, value):
|
||||
return self.target_field.get_prep_value(value)
|
||||
|
||||
def contribute_to_related_class(self, cls, related):
|
||||
super().contribute_to_related_class(cls, related)
|
||||
if self.remote_field.field_name is None:
|
||||
|
||||
Reference in New Issue
Block a user