blob: 8ccb7c5fc3cf367ec42bed8109071f95f04bf442 [file] [log] [blame]
Scott Bakerc7325a42014-05-30 16:06:46 -07001from view_common import *
Scott Baker823b7212014-06-16 10:25:39 -07002import random
Scott Baker78071582015-02-02 16:12:47 -08003from planetstack_analytics import DoPlanetStackAnalytics
Scott Bakerc7325a42014-05-30 16:06:46 -07004
5class DashboardAnalyticsAjaxView(View):
Scott Baker3307ce62015-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 Bakerc7325a42014-05-30 16:06:46 -070010 (mimetype, data) = DoPlanetStackAnalytics(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')