'Validate inline model admin classes.'

def validate_inlines(self, cls, model):

    from django.contrib.admin.options import BaseModelAdmin
    if hasattr(cls, 'inlines'):
        check_isseq(cls, 'inlines', cls.inlines)
        for (idx, inline) in enumerate(cls.inlines):
            if (not issubclass(inline, BaseModelAdmin)):
                raise ImproperlyConfigured(("'%s.inlines[%d]'    does    not    inherit    from    BaseModelAdmin." % (cls.__name__, idx)))
            if (not inline.model):
                raise ImproperlyConfigured(("'model'    is    a    required    attribute    of    '%s.inlines[%d]'." % (cls.__name__, idx)))
            if (not issubclass(inline.model, models.Model)):
                raise ImproperlyConfigured(("'%s.inlines[%d].model'    does    not    inherit    from    models.Model." % (cls.__name__, idx)))
            inline.validate(inline.model)
            self.check_inline(inline, model)
