def delete_stats_panes(request): if request.method == 'POST': stat_id = request.GET.get("id") SummaryStats.remove_user_stat(stat_id) return success_response([], []) else: return error_response(['Can only POST delete panes.'])
def get_stats_panes(request): if request.method == 'GET': return JsonResponse( { 'status': 1, 'stats': SummaryStats.get_user_stats(request.user.id) } ) else: return error_response(['Can only GET stat panes.'])
def testCouldNotCompute(self): generateTestFile(self.account_id, 'bad_data') resp = SummaryStats.generate_stats(self.account_id, 'bad_data.csv', ["mean", "min", "max", "sigma", "median"], "testtitle") self.assertIn(SummaryStats.COMPUTE_FAILURE, resp)
def clear_stats(request): SummaryStats.clear_stats() return success_response([], [])