Пример #1
0
    def get(self, request, app_name, format=None):
        now = timezone.now()
        app = self.get_object(app_name)

        date = MonthInputSerializer(data=request.GET)
        date.is_valid()
        date = date.validated_data.get('date', now)

        data = get_channel_statistics(app.id, date=date)
        serializer = StatisticsMonthsSerializer(dict(data=dict(data)))
        return Response(serializer.data)
Пример #2
0
    def get(self, request, app_name, format=None):
        now = timezone.now()
        app = self.get_object(app_name)

        date = MonthInputSerializer(data=request.GET)
        date.is_valid()
        date = date.validated_data.get('date', now)

        data = get_channel_statistics(app.id, date=date)
        serializer = StatisticsMonthsSerializer(dict(data=dict(data)))
        return Response(serializer.data)