diff options
author | vinay karanam <vinayinvicible@users.noreply.github.com> | 2018-07-27 15:35:54 +0000 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-07-27 11:35:54 -0400 |
commit | 3af695eda24b874486ee8be7e0d729761b3bdc71 (patch) | |
tree | 7549619d744e65fe6fa7cadcd1e3f9be6574abf5 /django/contrib/postgres/fields/array.py | |
parent | 69eb70456bfd42becdbdf1ca6043ae2e3263beb5 (diff) | |
download | django-3af695eda24b874486ee8be7e0d729761b3bdc71.tar.gz |
Fixed #28291, #24726 -- Fixed ArrayField with JSONField and RangeFields.
Diffstat (limited to 'django/contrib/postgres/fields/array.py')
-rw-r--r-- | django/contrib/postgres/fields/array.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/contrib/postgres/fields/array.py b/django/contrib/postgres/fields/array.py index ab667acd5b..a6079466af 100644 --- a/django/contrib/postgres/fields/array.py +++ b/django/contrib/postgres/fields/array.py @@ -84,6 +84,9 @@ class ArrayField(CheckFieldDefaultMixin, Field): size = self.size or '' return '%s[%s]' % (self.base_field.db_type(connection), size) + def get_placeholder(self, value, compiler, connection): + return '%s::{}'.format(self.db_type(connection)) + def get_db_prep_value(self, value, connection, prepared=False): if isinstance(value, (list, tuple)): return [self.base_field.get_db_prep_value(i, connection, prepared=False) for i in value] |