diff options
| author | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-06-05 21:56:00 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-11-12 09:22:44 -0500 |
| commit | 2c96b3da6f9be3795bd2ded59175332aa986bf2d (patch) | |
| tree | 14de704f03c51edfe0102b5b99b4ca299052409e /django/contrib/postgres/fields/array.py | |
| parent | 3ded51bcf21f384b2e80ce97aff5c12d63e5f0e3 (diff) | |
[1.8.x] Refs #24937 -- Backported more commits to fix for serialization of Date(Time)RangeField.
Instead of using DjangoJSONEncoder, use base_field's value_to_string().
Note this means the serialization of e.g. IntegerRangeField now has
strings for lower and upper, so use to_python when they came back in
(same behaviour as ArrayField, hopefully, from where I also got the
set_attributes_from_name function).
Backport of 86d9b10dc33cc115fee2ecab40a569354ac55d15 and
8a842148b6deaab021526e2689279cf5e232945f from master
Diffstat (limited to 'django/contrib/postgres/fields/array.py')
| -rw-r--r-- | django/contrib/postgres/fields/array.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/django/contrib/postgres/fields/array.py b/django/contrib/postgres/fields/array.py index 970355fd62..5d49d49e22 100644 --- a/django/contrib/postgres/fields/array.py +++ b/django/contrib/postgres/fields/array.py @@ -8,12 +8,9 @@ from django.db.models import Field, IntegerField, Transform from django.utils import six from django.utils.translation import string_concat, ugettext_lazy as _ -__all__ = ['ArrayField'] - +from .utils import AttributeSetter -class AttributeSetter(object): - def __init__(self, name, value): - setattr(self, name, value) +__all__ = ['ArrayField'] class ArrayField(Field): |
