#NEWLINE# @ addon_view_with_unlisted #NEWLINE# @ non_atomic_requests #NEWLINE# def usage_breakdown_series( request , addon , group , start , end , format , field ) : #NEWLINE# #INDENT# 'Generate ADU breakdown of ``field``.' #NEWLINE# date_range = check_series_params_or_404 ( group , start , end , format ) #NEWLINE# check_stats_permission ( request , addon ) #NEWLINE# fields = { #NEWLINE# #INDENT# 'applications' : 'apps' , #NEWLINE# 'locales' : 'locales' , #NEWLINE# 'oses' : 'os' , #NEWLINE# 'versions' : 'versions' , #NEWLINE# 'statuses' : 'status' , #NEWLINE# #UNINDENT# } #NEWLINE# series = get_series ( UpdateCount , source = fields [ field ] , addon = addon . id , date__range = date_range ) #NEWLINE# if ( field == 'locales' ) : #NEWLINE# #INDENT# series = process_locales ( series ) #NEWLINE# #UNINDENT# if ( format == 'csv' ) : #NEWLINE# #INDENT# if ( field == 'applications' ) : #NEWLINE# #INDENT# series = flatten_applications ( series ) #NEWLINE# #UNINDENT# ( series , fields ) = csv_fields ( series ) #NEWLINE# return render_csv ( request , addon , series , ( [ 'date' , 'count' ] + list ( fields ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( format == 'json' ) : #NEWLINE# #INDENT# return render_json ( request , addon , series )