Exemplo n.º 1
0
    def test_filter_data_insights(self):
        start_date = date(month=8, day=25, year=2015)
        end_date = date(month=9, day=15, year=2015)

        # insights.open_tickets_chart(start_date, end_date)

        insights.reply_moving_average(start_date, end_date)
Exemplo n.º 2
0
def users(start_date, end_date):
    chart = reply_moving_average(start_date, end_date).to_dict(orient='list')

    if not chart:
        return HttpResponse('{"result": []}')

    pairs = zip(chart['date'], chart['avg'])
    result = {"result": [{"date": k.strftime("%m/%d/%Y"), "DAU": v}
                         for k, v in pairs]}

    json_response = json.dumps(result)

    return HttpResponse(json_response)