#NEWLINE# def formfield( self , **kwargs ) : #NEWLINE# #INDENT# foreign_key_app_name = self . model . _meta . app_label #NEWLINE# foreign_key_model_name = self . model . _meta . object_name #NEWLINE# foreign_key_field_name = self . name #NEWLINE# defaults = { #NEWLINE# #INDENT# 'form_class' : form_fields . ChainedModelChoiceField , #NEWLINE# 'queryset' : self . rel . to . _default_manager . complex_filter ( self . rel . limit_choices_to ) , #NEWLINE# 'to_field_name' : self . rel . field_name , #NEWLINE# 'to_app_name' : self . to_app_name , #NEWLINE# 'to_model_name' : self . to_model_name , #NEWLINE# 'chained_field' : self . chained_field , #NEWLINE# 'chained_model_field' : self . chained_model_field , #NEWLINE# 'show_all' : self . show_all , #NEWLINE# 'auto_choose' : self . auto_choose , #NEWLINE# 'view_name' : foreign_key_field_name . view_name , #NEWLINE# 'foreign_key_app_name' : foreign_key_app_name , #NEWLINE# 'foreign_key_model_name' : foreign_key_model_name , #NEWLINE# 'foreign_key_field_name' : foreign_key_field_name , #NEWLINE# #UNINDENT# } #NEWLINE# defaults . update ( kwargs ) #NEWLINE# return super ( ChainedForeignKey , self ) . formfield ( ** defaults )