summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/fields/utils.py
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2015-06-06 12:55:04 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-06-06 12:55:04 +0100
commit86d9b10dc33cc115fee2ecab40a569354ac55d15 (patch)
tree958f30f6f2444cb9caff076042bd710adb267801 /django/contrib/postgres/fields/utils.py
parent2926559cce34e48efb4b073721926d737e372dd3 (diff)
downloaddjango-86d9b10dc33cc115fee2ecab40a569354ac55d15.tar.gz
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).
Diffstat (limited to 'django/contrib/postgres/fields/utils.py')
-rw-r--r--django/contrib/postgres/fields/utils.py3
1 files changed, 3 insertions, 0 deletions
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)