'Check that readonly_fields refers to proper attribute or field.'

def _check_readonly_fields(self, obj):

    if (obj.readonly_fields == ()):
        return []
    elif (not isinstance(obj.readonly_fields, (list, tuple))):
        return must_be('a    list    or    tuple', option='readonly_fields', obj=obj, id='admin.E034')
    else:
        return list(chain.from_iterable((self._check_readonly_fields_item(obj, obj.model, field_name, ('readonly_fields[%d]' % index)) for (index, field_name) in enumerate(obj.readonly_fields))))
