code: def to_representation(self, failure_line):
          
          try:
              matches = failure_line.error.matches.all()
          except AttributeError:  # failure_line.error can return None
              matches = []
          tle_serializer = TextLogErrorMatchSerializer(matches, many=True)
  
          classified_failures = models.ClassifiedFailure.objects.filter(error_matches__in=matches)
          cf_serializer = ClassifiedFailureSerializer(classified_failures, many=True)
  
          response = super().to_representation(failure_line)
          response['matches'] = tle_serializer.data
          response['classified_failures'] = cf_serializer.data
          return response
docs: Manually add matches our wrapper of the TLEMetadata -> TLE relation.
  
          I could not work out how to do this multiple relation jump with DRF (or
          even if it was possible) so using this manual method instead.