output annotations in text json

This commit is contained in:
Sanjay B 2021-10-23 15:45:25 +05:30
parent cac92d94f0
commit 4d1f6dc1aa

View file

@ -142,5 +142,7 @@ class Text(models.Model):
data['title'] = self.title data['title'] = self.title
data['byline'] = self.byline data['byline'] = self.byline
data['body'] = self.body data['body'] = self.body
if isinstance(self.annotations, list) and len(self.annotations) > 0:
data['annotations'] = self.annotations
data.update(self.data) data.update(self.data)
return json.dumps(data) return json.dumps(data)