Merge lp:~stevenk/lazr.restful/dict-unmarshaller-none into lp:lazr.restful

Proposed by Steve Kowalik
Status: Merged
Merged at revision: 202
Proposed branch: lp:~stevenk/lazr.restful/dict-unmarshaller-none
Merge into: lp:lazr.restful
Diff against target: 51 lines (+13/-1)
4 files modified
src/lazr/restful/NEWS.txt (+5/-0)
src/lazr/restful/docs/webservice-marshallers.txt (+5/-0)
src/lazr/restful/marshallers.py (+2/-0)
src/lazr/restful/version.txt (+1/-1)
To merge this branch: bzr merge lp:~stevenk/lazr.restful/dict-unmarshaller-none
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+126615@code.launchpad.net

Description of the change

The dict marshaller can now unmarshall None without de-praming its toys.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/lazr/restful/NEWS.txt'
2--- src/lazr/restful/NEWS.txt 2012-09-26 08:05:24 +0000
3+++ src/lazr/restful/NEWS.txt 2012-10-01 23:20:29 +0000
4@@ -2,6 +2,11 @@
5 NEWS for lazr.restful
6 =====================
7
8+0.19.8 (2012-10-02)
9+===================
10+
11+Fixed bug 1020439: The dict marshaller will now correctly unmarshall None.
12+
13 0.19.7 (2012-09-26)
14 ===================
15
16
17=== modified file 'src/lazr/restful/docs/webservice-marshallers.txt'
18--- src/lazr/restful/docs/webservice-marshallers.txt 2012-03-15 03:11:15 +0000
19+++ src/lazr/restful/docs/webservice-marshallers.txt 2012-10-01 23:20:29 +0000
20@@ -904,6 +904,11 @@
21 >>> sorted(unmarshalled.iteritems())
22 [(u'bar', 'General'), (u'foo', 'Vegetarian')]
23
24+The unmarshall() method will return None when given None.
25+
26+ >>> dict_marshaller.unmarshall(None, None)
27+ None
28+
29 CollectionField
30 ---------------
31
32
33=== modified file 'src/lazr/restful/marshallers.py'
34--- src/lazr/restful/marshallers.py 2012-03-15 03:32:05 +0000
35+++ src/lazr/restful/marshallers.py 2012-10-01 23:20:29 +0000
36@@ -536,6 +536,8 @@
37 The value is unmarshalled into a dict and all its items are
38 unmarshalled using the appropriate FieldMarshaller.
39 """
40+ if value is None:
41+ return value
42 return dict(
43 (self.key_marshaller.unmarshall(entry, key),
44 self.value_marshaller.unmarshall(entry, val))
45
46=== modified file 'src/lazr/restful/version.txt'
47--- src/lazr/restful/version.txt 2012-09-26 08:05:24 +0000
48+++ src/lazr/restful/version.txt 2012-10-01 23:20:29 +0000
49@@ -1,1 +1,1 @@
50-0.19.7
51+0.19.8

Subscribers

People subscribed via source and target branches