#NEWLINE# def get_m2m( parent_model , model ) : #NEWLINE# #INDENT# '\n    Returns ManyToManyField field.\n    ' #NEWLINE# for rel in parent_model . _meta . get_all_related_many_to_many_objects ( ) : #NEWLINE# #INDENT# if issubclass ( rel . related_model , model ) : #NEWLINE# #INDENT# return rel . field #NEWLINE# #UNINDENT# #UNINDENT# for rel in parent_model . _meta . many_to_many : #NEWLINE# #INDENT# if issubclass ( rel . related_model , model ) : #NEWLINE# #INDENT# return rel . field