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)
Source:stackexchange.com
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)