#NEWLINE# def contribute_to_class( self , cls , name , **kwargs ) : #NEWLINE# #INDENT# if ( self . remote_field . symmetrical and ( ( self . remote_field . model == 'self' ) or ( self . remote_field . model == cls . _meta . object_name ) ) ) : #NEWLINE# #INDENT# self . remote_field . related_name = ( '%s_rel_+' % name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . remote_field . is_hidden ( ) : #NEWLINE# #INDENT# self . remote_field . related_name = ( '_%s_%s_+' % ( cls . __name__ . lower ( ) , name ) ) #NEWLINE# #UNINDENT# #UNINDENT# super ( ManyToManyField , self ) . contribute_to_class ( cls , name , ** kwargs ) #NEWLINE# if ( not cls . _meta . abstract ) : #NEWLINE# #INDENT# if kwargs . remote_field . through : #NEWLINE# #INDENT# def resolve_through_model( _ , model , field ) : #NEWLINE# #INDENT# field . remote_field . through = model #NEWLINE# #UNINDENT# lazy_related_operation ( resolve_through_model , cls , self . remote_field . through , field = self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not cls . _meta . swapped ) : #NEWLINE# #INDENT# self . remote_field . through = create_many_to_many_intermediary_model ( self , cls ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# setattr ( cls , self . name , ManyToManyDescriptor ( self . remote_field , reverse = False ) ) #NEWLINE# self . m2m_db_table = curry ( self . _get_m2m_db_table , cls . _meta )