[Answered ]-Cannot reduce "SELECT" queries with "select_related()" and "prefetch_related()" in one-to-one relationship in Django

1👍

You will have to specify the name of the related field which in this case is persondetail, so:

for obj in Person.objects.select_related("persondetail").all():
    print(obj.persondetail)

Leave a comment