blob: 8661cf40f492c19250b031db6cf6b61d13d2e6b7 [file] [log] [blame]
Scott Bakerc7325a42014-05-30 16:06:46 -07001from view_common import *
Scott Baker823b7212014-06-16 10:25:39 -07002import random
Scott Baker2a8c5012015-02-18 16:55:13 -08003from xos_analytics import DoXOSAnalytics
Scott Bakerc7325a42014-05-30 16:06:46 -07004
5class DashboardAnalyticsAjaxView(View):
Scott Bakerd3a10122015-02-02 16:23:52 -08006 url = r'^analytics/(?P<name>\w+)/$'
7
Scott Bakerc7325a42014-05-30 16:06:46 -07008 def get(self, request, name="hello_world", **kwargs):
Scott Baker4879fca2014-05-30 16:10:35 -07009 if (name == "bigquery"):
Scott Baker2a8c5012015-02-18 16:55:13 -080010 (mimetype, data) = DoXOSAnalytics(request)
Scott Baker823b7212014-06-16 10:25:39 -070011 return HttpResponse(data, content_type=mimetype)
Scott Bakerc7325a42014-05-30 16:06:46 -070012 else:
Scott Baker823b7212014-06-16 10:25:39 -070013 return HttpResponse(json.dumps("Unknown"), content_type='application/javascript')