I am trying to extract data from a Foreign Key related field in django rest framework using PrimaryKey.

Views.py

class DispatchervsLrAPIView(CreateAPIView):

```
def get(self, request):

    date_to = request.data['date_to']
    date_from = request.data['date_from']
    company_id = request.data['c_name']

    company_emp = Teacher.objects.filter(company_id=company_id).values_list('user_id', flat=True)

    d = LR.objects.filter(Q(created_on__range=[date_to, date_from]) | Q(lr_quiz_id__owner_id__in=list(company_emp)))
    print(" d is ", d)
    serializer = DispvsLRSerializer(d, many=True)

    return Response(serializer.data, status=status.HTTP_201_CREATED)

```

Serializers.py

```
class DispvsLRSerializer(serializers.ModelSerializer):
    lr_quiz = serializers.PrimaryKeyRelatedField
    class Meta:
        model = LR
        fields = "__all__"

```

But the output I am given in postman is this:

```
[
    {
        "id": 1,
        "lr_no": 0,
        "lr_date": "2019-11-10T12:45:33.478763",
        "lr_billingparty": "0",
        "invoice_no": 0,
        "lr_declared": 0,
        "ewaybill_no": 0,
        "lr_quantity": 0,
        "lr_weight": 0,
        "lr_invoice_date": "2019-11-10T12:45:33.478763",
        "lr_item_name": "0",
        "lr_consignor_name": "0",
        "lr_consignor_address": "0",
        "lr_consignor_contact_name": "0",
        "lr_consignor_contact_phone": "0",
        "lr_consignee_name": "0",
        "lr_consignee_address": "0",
        "lr_consignee_contact_name": "0",
        "lr_consignee_contact_phone": "0",
        "vehicle_no": "0",
        "lr_vehicle_type": 0,
        "driver_name": "0",
        "driver_no": "0",
        "created_on": "2019-11-10T00:00:00",
        "lr_quiz": 1,
        "lr_owner": 2
    }
]

```

How can I expand the **"lr\_quiz"** ? where lr\_quiz is a foreign Key related field

Models.py

```
class LR(models.Model):
    lr_quiz = models.ForeignKey(Quiz, on_delete=models.CASCADE, related_name='quiz_lr')
    lr_owner = models.ForeignKey(Supplier, on_delete=models.CASCADE, related_name='lr_owner')

    lr_no = models.IntegerField(default=0)
    lr_date = models.DateTimeField(max_length=255, default=now)
    lr_billingparty = models.CharField(max_length=255, default=0)  
    (shortened for easy readibility)

class Quiz(models.Model):

    comments = models.TextField(max_length=256, blank=True)
    origin = models.CharField(max_length=255, default=0)
    destination = models.CharField(max_length=255, default=0)
    total_trucks = models.IntegerField(default=0)

```

I want the data of both LR and its related quiz