From e7e5d9b338cabaafc61b7a0c55ff395b533d8c9e Mon Sep 17 00:00:00 2001 From: Matt C Date: Tue, 15 Mar 2016 19:23:44 +1100 Subject: [PATCH] Fixed #25579 -- Fixed ArrayField.get_db_prep_value() to allow complex types. --- django/contrib/postgres/fields/array.py | 2 +- tests/postgres_tests/models.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/django/contrib/postgres/fields/array.py b/django/contrib/postgres/fields/array.py index 8ec5f88e9e..e550c4b260 100644 --- a/django/contrib/postgres/fields/array.py +++ b/django/contrib/postgres/fields/array.py @@ -84,7 +84,7 @@ class ArrayField(Field): def get_db_prep_value(self, value, connection, prepared=False): if isinstance(value, list) or isinstance(value, tuple): - return [self.base_field.get_db_prep_value(i, connection, prepared) for i in value] + return [self.base_field.get_db_prep_value(i, connection, prepared=False) for i in value] return value def deconstruct(self): diff --git a/tests/postgres_tests/models.py b/tests/postgres_tests/models.py index b950134bb9..24addea358 100644 --- a/tests/postgres_tests/models.py +++ b/tests/postgres_tests/models.py @@ -31,9 +31,6 @@ class TagField(models.SmallIntegerField): def get_prep_value(self, value): return value.tag_id - def get_db_prep_value(self, value, connection, prepared=False): - return self.get_prep_value(value) - class PostgreSQLModel(models.Model): class Meta: