def _check_ordering(self, obj):

        # ordering = None
        if obj.ordering is None:  # The default value is None
            return []
        elif not isinstance(obj.ordering, (list, tuple)):
            return must_be('a list or tuple', option='ordering', obj=obj, id='admin.E031')
        else:
            return list(chain(*[
                self._check_ordering_item(obj, obj.model, field_name, 'ordering[%d]' % index)
                for index, field_name in enumerate(obj.ordering)
            ]))
Check that ordering refers to existing fields or is random.
dataset/ETHPy150Open django/django/django/contrib/admin/checks.py/BaseModelAdminChecks._check_ordering