Exemple #1
0
 def render(cls, page, data = None):
   if not data:
     return NoRenderer.render(page)
   
   stats = Statistics.get_by_campaign_and_namespace(page.campaign, page.namespace) # todo, how to clean the type assoc to the campaign/namespace
   logging.info('Getting visualization for: %s' % stats.type)
   url = visualize.get(stats.type).get_url(page.request, data)
   logging.info('Redirecting to: %s' % url)
   if url:
     if DEBUG:
       return page.response.out.write('<img src="%s" />' % url)
     return page.redirect(url)
   page.response.set_status(500)
Exemple #2
0
 def get_statistics(cls, campaign, ns, path = ''):
   data = Statistics.get_by_campaign_and_namespace(campaign, ns)
   if (data and path):
     data = util.getattr_by_path(data, path)
   return data