'Validate that fk_name refers to a ForeignKey.'

def validate_fk_name(self, cls, model):

    if cls.fk_name:
        f = get_field(cls, model, 'fk_name', cls.fk_name)
        if (not isinstance(f, models.ForeignKey)):
            raise ImproperlyConfigured(("'%s.fk_name    is    not    an    instance    of    models.ForeignKey." % cls.__name__))
