Skip to content

Commit ca41f83

Browse files
author
Mike Hearing
committed
Properly handling NoneType
1 parent c0a8dd3 commit ca41f83

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pyrestorm/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pyrestorm.exceptions import orm as orm_exceptions
66
from pyrestorm.manager import RestOrmManager
77

8-
primitives = [int, str, unicode, bool]
8+
primitives = [int, str, unicode, bool, type(None)]
99

1010

1111
class RestModelBase(type):

tests/test_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_restmodel_nestedstructures(self):
7373
post.comments = [Comment(body='Are we having fun yet?'), Comment(body='Hoe about now?')]
7474
post.fun_numbers = [1, 2, 3, 5, 7]
7575
post.meta = {'datetime': 'September 23, 2016'}
76+
post.archived = None
7677
post.save()
7778
self.assertEqual(post.id, 101)
7879

0 commit comments

Comments
 (0)