def check_inline(self, cls, parent_model):
        " Validate inline class's fk field is not excluded. "
        fk = _get_foreign_key(parent_model, cls.model, fk_name=cls.fk_name, can_fail=True)
        if hasattr(cls, 'exclude') and cls.exclude:
            if fk and fk.name in cls.exclude:
                raise ImproperlyConfigured("%s cannot exclude the field "
                        "'%s' - this is the foreign key to the parent model "
                        "%s.%s." % (cls.__name__, fk.name, parent_model._meta.app_label, parent_model.__name__))
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/contrib/admin/validation.py/ModelAdminValidator.check_inline/original