'A dict respresentation of this for JSON encoding'

def as_dict(self):

    hash = get_random_string()
    domain = getattr(settings, 'PRODUCTION_DOMAIN', 'readthedocs.org')
    if self.image:
        image_url = '//{host}{url}'.format(host=domain, url=reverse('donate_view_proxy', kwargs={'promo_id': self.pk, 'hash': hash}))
    else:
        image_url = None
    link_url = '//{host}{url}'.format(host=domain, url=reverse('donate_click_proxy', kwargs={'promo_id': self.pk, 'hash': hash}))
    return {'id': self.analytics_id, 'text': self.text, 'link': link_url, 'image': image_url, 'hash': hash}
