@addon_view
@non_atomic_requests
def contributions_series(request, addon, group, start, end, format):
 date_range = check_series_params_or_404(group, start, end, format)
 check_stats_permission(request, addon, for_contributions=True)
 qs = Contribution.objects.extra(select={'date_created': 'date(created)'}).filter(addon=addon, amount__gt=0, transaction_id__isnull=False, created__range=date_range).values('date_created').annotate(count=Count('amount'), average=Avg('amount'), total=Sum('amount'))
 series = sorted(qs, key=(lambda x: x['date_created']), reverse=True)
 for row in series:
  row['end'] = row['date'] = row.pop('date_created')
 if (format == 'csv'):
  return render_csv(request, addon, series, ['date', 'count', 'total', 'average'])
 elif (format == 'json'):
  return render_json(request, addon, series)

@ addon_view @ non_atomic_requests def contributions_series ( request , addon , group , start , end , format ) : date_range = check_series_params_or_404 ( group , start , end , format ) check_stats_permission ( request , addon , for_contributions = True ) qs = Contribution . objects . extra ( select = { 'date_created' : 'date(created)' } ) . filter ( addon = addon , amount__gt = 0 , transaction_id__isnull = False , created__range = date_range ) . values ( 'date_created' ) . annotate ( count = Count ( 'amount' ) , average = Avg ( 'amount' ) , total = Sum ( 'amount' ) ) series = sorted ( qs , key = ( lambda x : x [ 'date_created' ] ) , reverse = True ) for row in series : row [ 'end' ] = row [ 'date' ] = row . pop ( 'date_created' ) if ( format == 'csv' ) : return render_csv ( request , addon , series , [ 'date' , 'count' , 'total' , 'average' ] ) elif ( format == 'json' ) : return render_json ( request , addon , series )
generate summarized contributions grouped by group in format .