Ejemplo n.º 1
0
 def to_json(self):
     return json_object({
         "date": json_value(web.websafe(self.formatted_date())),
         "author": json_value(web.websafe(self.author)),
         "text": json_value(self.marked_down_text()),
         "line_number": json_value(web.websafe(self.line_number))
     })
 def to_json(self):
     json_group = {}
     for key in self.comments:
         json_group[str(key)] = json_list(
             comment.to_json() for comment in self.comments[key]
         )
     return json_object(json_group)