#NEWLINE# def bridge_choices( self , chosen , choices ) : #NEWLINE# #INDENT# if ( len ( choices ) == 0 ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# if ( len ( chosen ) == 0 ) : #NEWLINE# #INDENT# chosen_level = 0 #NEWLINE# bridge_to_single = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# chosen_level = chosen [ ( - 1 ) ] . range_type . level #NEWLINE# bridge_to_single = ( not chosen [ ( - 1 ) ] . range_type . single ) #NEWLINE# #UNINDENT# new_choice = choices [ 0 ] #NEWLINE# new_level = new_choice . range_type . level #NEWLINE# retval = [ ] #NEWLINE# while ( ( chosen_level < ( new_level - 1 ) ) or ( ( chosen_level < new_level ) and bridge_to_single ) ) : #NEWLINE# #INDENT# if bridge_to_single : #NEWLINE# #INDENT# bridge_to_single = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# chosen_level += 1 #NEWLINE# #UNINDENT# if ( chosen_level > self . max_depth_level ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# date_choice = DateChoice ( DateRangeType . get ( new_level , True ) , new_choice . values ) #NEWLINE# retval . append ( FilterChoice ( self . render_choice_object ( date_choice ) , None , None , FILTER_DISPLAY ) ) #NEWLINE# #UNINDENT# return retval