code: def formfield_for_dbfield(self, db_field, **kwargs):
          
          if isinstance(db_field, models.ForeignKey) and db_field.name in self.related_search_fields:
              help_text = self.get_help_text(db_field.name, db_field.remote_field.model._meta.object_name)
              if kwargs.get('help_text'):
                  help_text = six.u('%s %s' % (kwargs['help_text'], help_text))
              kwargs['widget'] = ForeignKeySearchInput(db_field.remote_field, self.related_search_fields[db_field.name])
              kwargs['help_text'] = help_text
          return super(ForeignKeyAutocompleteAdminMixin, self).formfield_for_dbfield(db_field, **kwargs)
docs: Override the default widget for Foreignkey fields if they are
          specified in the related_search_fields class attribute.