Fom

Code review comment for lp:~ntoll/fom/instance-pre-populate-search-812246

Revision history for this message
Jamu Kakar (jkakar) wrote :

[1]

         self.db.add_resp(200, 'application/json',
- '{"ids": ["466"]}')
+ '''{"results":{"id": {"05eee31e-fbd1-43cc-9500-0469707a9bc3":{
+ "fluiddb/users/username":{"value": "ntoll"},
+ "fluiddb/users/name":{"value": "Nicholas"},
+ "fluiddb/about": {"value": "Object about the user ntoll"}}}}}''')

There are a few bits of code like this. I think they'd be easier to
read if the data was split up a bit and used the json module:

         objectValues = {
             'fluiddb/users/username': {'value': 'ntoll'},
             'fluiddb/users/name': {'value': 'Nicholas'},
             'fluiddb/about': {'value': 'Object about the user ntoll'}}
         resultValues = {'05eee31e-fbd1-43cc-9500-0469707a9bc3': objectData}
         self.db.add_resp(200, 'application/json',
                          dumps({'results': {'id': resultValues}}))

Nice work, +1!

review: Approve

« Back to merge proposal