  
  
  class OrderingDottedRelatedSerializer(serializers.ModelSerializer):
      related_text = serializers.CharField(source='related_object.text')
      related_title = serializers.CharField(source='related_object.title')
  
      class Meta:
          model = OrderingFilterRelatedModel
 
</s> remove             if not getattr(field, 'write_only', False) and not field.source == '*'
 </s> add             if (
                not getattr(field, 'write_only', False) and
                not field.source == '*' and
                field.source not in model_property_names
            )
class OrderingFilterSerializerWithModelProperty(serializers.ModelSerializer):
    class Meta:
        model = OrderingFilterModel
        fields = (
            "id",
            "title",
            "text",
            "description"
        )


  
  
class OrderingFilterSerializerWithModelProperty(serializers.ModelSerializer):
    class Meta:
        model = OrderingFilterModel
        fields = (
            "id",
            "title",
            "text",
            "description"
        )


  class OrderingDottedRelatedSerializer(serializers.ModelSerializer):
      related_text = serializers.CharField(source='related_object.text')
      related_title = serializers.CharField(source='related_object.title')
  
      class Meta:
          model = OrderingFilterRelatedModel
keep add keep 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 
tests/test_filters.py