ShriyansAgro

deserializer

Jun 11th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. def deserialize(self, obj):
  2. pdb.set_trace()
  3.  
  4. data = {"@type": "File","title": "My file","file": {"data":"SSBib3VnaHQgbmV3IGlQaG9uZTcgMTI4Rw==","encoding": "base64","filename": "iPhone7.txt","content-type": "text/plain"},"description": "new temp text file","Path": "/plone/talks/file1"}
  5.  
  6. type_ = data.get('@type', None)
  7. path_ = data.get('Path', None)
  8. title = data.get('title', None)
  9.  
  10. try:
  11. new_id = self.context.invokeFactory(type_, path_, title=title)
  12. except:
  13. print 'error in raising new key'
  14.  
  15. obj=self.context[new_id]
  16. deserializer = queryMultiAdapter((obj, self.request), IDeserializeFromJson)
Add Comment
Please, Sign In to add comment