#NEWLINE# def get_data( self ) : #NEWLINE# #INDENT# model = self . model . model_class ( ) #NEWLINE# model_manager = model . _default_manager #NEWLINE# aggregate_type = AggregateType . from_id ( self . aggregate_type ) #NEWLINE# queryset = model_manager . all ( ) #NEWLINE# filters = self . params . get ( 'filters' , None ) #NEWLINE# excludes = self . params . get ( 'excludes' , None ) #NEWLINE# annotate_filters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if filters : #NEWLINE# #INDENT# annotate_filters = self . pop_annotate_filters ( filters ) #NEWLINE# queryset = FilterParser ( queryset , filters ) . get_queryset ( ) #NEWLINE# #UNINDENT# if excludes : #NEWLINE# #INDENT# queryset = FilterParser ( queryset , excludes , exclude_mode = True ) . get_queryset ( ) #NEWLINE# #UNINDENT# aggregate_func = aggregate_type . aggregate_func #NEWLINE# queryset = queryset . values ( self . params [ 'labels' ] ) . annotate ( series = aggregate_func ( self . params [ 'series' ] ) ) #NEWLINE# if annotate_filters : #NEWLINE# #INDENT# queryset = queryset . filter ( ** annotate_filters ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'labels' : [ q [ self . params [ 'labels' ] ] for q in queryset ] , #NEWLINE# 'series' : [ int ( q [ 'series' ] ) for q in queryset ] , #NEWLINE# #UNINDENT# }