[Answer]-Django accessing foreign key value from api

1👍

Use the double underscore to access a ForeignKey relationships attributes

student_detail = Student.objects.filter(last_name=pk, campus__name=pk2)

Leave a comment