def default(self, json_obj): if json_obj['mimetype'] == Quote.json_mimetype: q = Quote() q.id = int(json_obj['id']) q.up_votes = int(json_obj['up']) q.down_votes = int(json_obj['down']) q.body = json_obj['body'] q.tags = [QuoteDecoder.default(self, t) for t in json_obj['tags']] return q elif json_obj['mimetype'] == Tag.json_mimetype: t = Tag() t.id = int(json_obj['id']) t.tag = json_obj['tag'] return tag else: return json.JSONDecoder.default(self, json_obj)