  
          return [
              (field.source.replace('.', '__') or field_name, field.label)
              for field_name, field in serializer_class(context=context).fields.items()
              if not getattr(field, 'write_only', False) and not field.source == '*'
          ]
  
      def get_valid_fields(self, queryset, view, context={}):
          valid_fields = getattr(view, 'ordering_fields', self.ordering_fields)
  
 
</s>
            if (
                not getattr(field, 'write_only', False) and
                not field.source == '*' and
                field.source not in model_property_names
            )
  
          return [
              (field.source.replace('.', '__') or field_name, field.label)
              for field_name, field in serializer_class(context=context).fields.items()
            if (
                not getattr(field, 'write_only', False) and
                not field.source == '*' and
                field.source not in model_property_names
            )
          ]
  
      def get_valid_fields(self, queryset, view, context={}):
          valid_fields = getattr(view, 'ordering_fields', self.ordering_fields)
  
keep keep keep keep replace keep keep keep keep keep
 Ordering filter bug with model property serializer field (#7609)

* Add failing tests for ordering filter with model property

* Fix get_default_valid_fields of OrderingFilter

* Filter model properties in get_default_valid_fields of OrderingFilter
rest_framework/filters.py