From 2c96b3da6f9be3795bd2ded59175332aa986bf2d Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 5 Jun 2015 21:56:00 +0100 Subject: [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 --- django/contrib/postgres/fields/utils.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 django/contrib/postgres/fields/utils.py (limited to 'django/contrib/postgres/fields/utils.py') diff --git a/django/contrib/postgres/fields/utils.py b/django/contrib/postgres/fields/utils.py new file mode 100644 index 0000000000..424a78f521 --- /dev/null +++ b/django/contrib/postgres/fields/utils.py @@ -0,0 +1,3 @@ +class AttributeSetter(object): + def __init__(self, name, value): + setattr(self, name, value) -- cgit v1.3