Skip to content

Commit e1fe062

Browse files
authored
Merge pull request #39 from feliphebueno/2.2.5
Add DjangoJSONEncoder on Response content serialization - OK
2 parents 7b8b798 + e9b7d3a commit e1fe062

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
Version 2.2.5:
3+
Update 2.2.4
4+
- Add django.core.serializers.json.DjangoJSONEncoder on Response content serialization in order to provide
5+
out-of-the-box JSON serialization of complex objects such as datetime, Decimal, et cetera
6+
27
Version 2.2.4:
38
Update 2.2.3
49
- Fixed token memory leaking when calling callback response

requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Django==2.2.12
2+
pytz==2020.1
3+
PyYAML==5.3.1
4+
raven==6.9.0
5+
setuptools==40.6.2
6+
wheel==0.35.1
7+
twine==3.2.0

rinzler/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from django.core.exceptions import RequestDataTooBig
77

88
__name__ = "Rinzler REST Framework"
9-
__version__ = "2.2.4"
9+
__version__ = "2.2.5"
1010
__author__ = ["Rinzler<github.com/feliphebueno>", "4ndr<github.com/4ndr>"]
1111

1212
import os

rinzler/core/response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import json
77
from collections import OrderedDict
8+
9+
from django.core.serializers.json import DjangoJSONEncoder
810
from django.http.response import HttpResponse
911

1012

@@ -45,12 +47,12 @@ def render(self, indent=0):
4547
def __str__(self):
4648
if self.__indent > 0:
4749
if self.__content is not None:
48-
return json.dumps(self.__content, indent=self.__indent, sort_keys=False)
50+
return json.dumps(self.__content, indent=self.__indent, sort_keys=False, cls=DjangoJSONEncoder)
4951
else:
5052
return str()
5153
else:
5254
if self.__content is not None:
53-
return json.dumps(self.__content, sort_keys=False)
55+
return json.dumps(self.__content, sort_keys=False, cls=DjangoJSONEncoder)
5456
else:
5557
return str()
5658

0 commit comments

Comments
 (0)