Scott Baker | c7325a4 | 2014-05-30 16:06:46 -0700 | [diff] [blame] | 1 | from view_common import * |
Scott Baker | 823b721 | 2014-06-16 10:25:39 -0700 | [diff] [blame] | 2 | import random |
Scott Baker | 2a8c501 | 2015-02-18 16:55:13 -0800 | [diff] [blame^] | 3 | from xos_analytics import DoXOSAnalytics |
Scott Baker | c7325a4 | 2014-05-30 16:06:46 -0700 | [diff] [blame] | 4 | |
| 5 | class DashboardAnalyticsAjaxView(View): |
Scott Baker | d3a1012 | 2015-02-02 16:23:52 -0800 | [diff] [blame] | 6 | url = r'^analytics/(?P<name>\w+)/$' |
| 7 | |
Scott Baker | c7325a4 | 2014-05-30 16:06:46 -0700 | [diff] [blame] | 8 | def get(self, request, name="hello_world", **kwargs): |
Scott Baker | 4879fca | 2014-05-30 16:10:35 -0700 | [diff] [blame] | 9 | if (name == "bigquery"): |
Scott Baker | 2a8c501 | 2015-02-18 16:55:13 -0800 | [diff] [blame^] | 10 | (mimetype, data) = DoXOSAnalytics(request) |
Scott Baker | 823b721 | 2014-06-16 10:25:39 -0700 | [diff] [blame] | 11 | return HttpResponse(data, content_type=mimetype) |
Scott Baker | c7325a4 | 2014-05-30 16:06:46 -0700 | [diff] [blame] | 12 | else: |
Scott Baker | 823b721 | 2014-06-16 10:25:39 -0700 | [diff] [blame] | 13 | return HttpResponse(json.dumps("Unknown"), content_type='application/javascript') |