'Get a form Field for a ForeignKey.'

def formfield_for_foreignkey(self, db_field, request=None, **kwargs):

    db = kwargs.get('using')
    if (db_field.name in self.raw_id_fields):
        kwargs['widget'] = widgets.ForeignKeyRawIdWidget(db_field.rel, self.admin_site, using=db)
    elif (db_field.name in self.radio_fields):
        kwargs['widget'] = widgets.AdminRadioSelect(attrs={'class': get_ul_class(self.radio_fields[db_field.name])})
        kwargs['empty_label'] = ((db_field.blank and _('None')) or None)
    return db_field.formfield(**kwargs)
