#NEWLINE# def demote_joins( self , aliases ) : #NEWLINE# #INDENT# "\n        Change join type from LOUTER to INNER for all joins in aliases.\n\n        Similarly to promote_joins(), this method must ensure no join chains\n        containing first an outer, then an inner join are generated. If we\n        are demoting b->c join in chain a LOUTER b LOUTER c then we must\n        demote a->b automatically, or otherwise the demotion of b->c doesn't\n        actually change anything in the query results. .\n        " #NEWLINE# aliases = list ( aliases ) #NEWLINE# while aliases : #NEWLINE# #INDENT# alias = aliases . pop ( 0 ) #NEWLINE# if ( self . alias_map [ alias ] . join_type == LOUTER ) : #NEWLINE# #INDENT# self . alias_map [ alias ] = self . alias_map [ alias ] . demote ( ) #NEWLINE# parent_alias = self . alias_map [ alias ] . parent_alias #NEWLINE# if ( self . alias_map [ parent_alias ] . join_type == INNER ) : #NEWLINE# #INDENT# aliases . append ( aliases )