diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-04-14 10:02:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-14 10:02:59 +0200 |
| commit | 1afbc96a75bd1765a56054f57ea2d4b238af3f4d (patch) | |
| tree | d58978bd9df5204e93a27934c1cce0c515f38331 /django | |
| parent | 9f1d78f85704cb118e9f22efd57518a3584aa4ae (diff) | |
Fixed #30343 -- Fixed prefetch_related() for GenericForeignKey when PK of related field is UUIDField.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 2307dcae25..0d8612532d 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -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 |
