title: Django Rest Framework, display data from a table referenced with a foreign key
body: <p>I got stuck a bit with a small problem when doing my school project, the problem is that I have an api with DRF and wanting to show my patient data "main table" shows them without problems but when I want to show other patient data in a different table (this table is this reference with a foreign key to Patient) I have not managed to obtain the patient data from this other table.</p>
  
  <p>I can not make my api send me the other patient data from the foreign key referenced to the patient, could you help me?</p>
  
  <p>models.py</p>
  
  <pre><code>class Paciente(TimeStampedModel):
      user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
      udi = models.UUIDField(default=uuid.uuid4, editable=False)
      first_name = models.CharField('Nombre(s)', max_length=100)
      last_name = models.CharField('Apellidos', max_length=100)
      gender = models.CharField('Sexo', max_length=20, choices=GENDER_CHOICES)
      birth_day = models.DateField('Fecha de nacimiento', blank=True, null=True)
      phone_number = models.CharField('Número de telefono', max_length=13)
      civil_status = models.CharField('Estado civil', max_length=20, choices=CIVIL_STATUS_CHOICES)
      etc.....
  
  class Antecedentes(TimeStampedModel):
      """
      Modelo de motivo y antecedentes de la enfermedad presentada en el momento de
      la consulta
      """
      user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
      paciente = models.ForeignKey(Paciente, on_delete=models.CASCADE, null=True)
      motivo = models.TextField('Motivo de la consulta')
      antecedentes = models.TextField('Antecedentes de la enfermedad actual', blank=True, null=True)
  </code></pre>
  
  <p>serializers.py</p>
  
  <pre><code>class antecedenteSerializer(serializers.ModelSerializer):
      user = serializers.ReadOnlyField(source="user.username")
  
      class Meta:
          model = Antecedentes
          fields = ('paciente' ,'motivo', 'antecedentes', )
  </code></pre>
  
  <p>views.py
  I was trying this but I'm not if this is correct or not</p>
  
  <pre><code>from historiaClinica import models as modelsHC
  class antecedenteList(APIView):
      """
      Lista todos los antecedentes o crea uno nuevo
      """
      def get_object(self, pk):
          try:
              paciente = get_object_or_404(pk=pk)
              return modelsHC.Antecedentes.objects.get(paciente=paciente)
          except modelsHC.Antecedentes.DoesNotExist:
              raise Http404
      def get(self, request, pk, format=None):
          antecedente = self.get_object(pk)
          serializer = antecedenteSerializer(antecedente)
          return Response(serializer.data)
  </code></pre>