#NEWLINE# def handle_class_prepared( sender , **kwargs ) : #NEWLINE# #INDENT# '\n    See if this class needs registering of fields\n    ' #NEWLINE# from . settings import M2M_REGISTRY , FK_REGISTRY #NEWLINE# from . registration import registry #NEWLINE# sender_app = sender . _meta . app_label #NEWLINE# sender_name = sender . _meta . model_name #NEWLINE# for ( key , val ) in list ( FK_REGISTRY . items ( ) ) : #NEWLINE# #INDENT# ( app_name , model_name ) = key . split ( '.' ) #NEWLINE# if ( ( app_name == sender_app ) and ( sender_name == model_name ) ) : #NEWLINE# #INDENT# registry . register_model ( app_name , sender , 'ForeignKey' , val ) #NEWLINE# #UNINDENT# #UNINDENT# for ( key , val ) in list ( M2M_REGISTRY . items ( ) ) : #NEWLINE# #INDENT# ( app_name , model_name ) = key . split ( '.' ) #NEWLINE# if ( ( app_name == sender_app ) and ( sender_name == model_name ) ) : #NEWLINE# #INDENT# registry . register_model ( app_name , sender_name , 'ManyToManyField' , val )