#NEWLINE# def get_ranges( self , request ) : #NEWLINE# #INDENT# mapped = { #NEWLINE# #INDENT# 'start_time' : request . query_params . get ( 'from' ) , #NEWLINE# 'end_time' : request . query_params . get ( 'to' ) , #NEWLINE# 'interval' : request . query_params . get ( 'interval' ) , #NEWLINE# #UNINDENT# } #NEWLINE# data = { key : val for ( key , val ) in mapped . items ( ) if val } #NEWLINE# serializer = core_serializers . TimelineSerializer ( data = data ) #NEWLINE# serializer . is_valid ( raise_exception = True ) #NEWLINE# date_points = serializer . get_date_points ( ) #NEWLINE# reversed_dates = date_points [ : : ( - 1 ) ] #NEWLINE# ranges = zip ( reversed_dates [ : ( - 1 ) ] , reversed_dates [ 1 : ] ) #NEWLINE# return ranges