#NEWLINE# def alter_index_together( self , model , old_index_together , new_index_together ) : #NEWLINE# #INDENT# '\n        Deals with a model changing its index_together.\n        Note: The input index_togethers must be doubly-nested, not the single-\n        nested ["foo", "bar"] format.\n        ' #NEWLINE# olds = set ( ( tuple ( fields ) for fields in old_index_together ) ) #NEWLINE# news = set ( ( tuple ( fields ) for fields in new_index_together ) ) #NEWLINE# for fields in olds . difference ( news ) : #NEWLINE# #INDENT# self . _delete_composed_index ( model , fields , { #NEWLINE# #INDENT# 'index' : True , #NEWLINE# #UNINDENT# } , self . sql_delete_index ) #NEWLINE# #UNINDENT# for field_names in news . difference ( olds ) : #NEWLINE# #INDENT# fields = [ model . _meta . get_field ( self ) for field in field_names ] #NEWLINE# self . execute ( self . _create_index_sql ( model , fields , suffix = '_idx' ) )