1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30343 -- Fixed prefetch_related() for GenericForeignKey when PK of related field is UUIDField.

This commit is contained in:
Mariusz Felisiak
2019-04-14 10:02:59 +02:00
committed by GitHub
parent 9f1d78f857
commit 1afbc96a75
3 changed files with 23 additions and 5 deletions

View File

@@ -2325,6 +2325,10 @@ class UUIDField(Field):
def get_internal_type(self):
return "UUIDField"
def get_prep_value(self, value):
value = super().get_prep_value(value)
return self.to_python(value)
def get_db_prep_value(self, value, connection, prepared=False):
if value is None:
return None