Skip to content

Commit fac9606

Browse files
author
Mike Hearing
committed
Handling bad object detection
1 parent ca41f83 commit fac9606

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pyrestorm/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.0'
1+
__version__ = '0.1.1'

pyrestorm/models.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from pyrestorm.manager import RestOrmManager
77

88
primitives = [int, str, unicode, bool, type(None)]
9+
non_object_types = [dict, list, tuple]
910

1011

1112
class RestModelBase(type):
@@ -108,7 +109,7 @@ def _serialize_data(self, obj):
108109
local_diff = {}
109110

110111
# Convert to dictionary
111-
if isinstance(obj, dict) is False:
112+
if type(obj) not in (primitives + non_object_types):
112113
obj = obj.__dict__
113114

114115
# For all of the top level keys

0 commit comments

Comments
 (0)