def update(campaign_id, data): c = campaign.get(campaign_id) description = c.description try: description = json.loads(description) except ValueError: description = dict(text=description) if 'updates' not in description: description['updates'] = list() description['updates'].append(data) campaign.update(c, description=json.dumps(description)) return description