'Validate that list_display only contains fields or usable attributes.'

def validate_list_display(self, cls, model):

    if hasattr(cls, 'list_display'):
        check_isseq(cls, 'list_display', cls.list_display)
        for (idx, field) in enumerate(cls.list_display):
            if (not callable(field)):
                if (not hasattr(cls, field)):
                    if (not hasattr(model, field)):
                        try:
                            model._meta.get_field(field)
                        except models.FieldDoesNotExist:
                            raise ImproperlyConfigured(('%s.list_display[%d],    %r    is    not    a    callable    or    an    attribute    of    %r    or    found    in    the    model    %r.' % (cls.__name__, idx, field, cls.__name__, model._meta.object_name)))
                    else:
                        f = fetch_attr(cls, model, ('list_display[%d]' % idx), field)
                        if isinstance(f, models.ManyToManyField):
                            raise ImproperlyConfigured(("'%s.list_display[%d]',    '%s'    is    a    ManyToManyField    which    is    not    supported." % (cls.__name__, idx, field)))
