AD
qs = User.objects.prefetch_related("created_deals")
for user in qs:
for deal in user.created_deals.all():
print (deal)
print('Queries performed:', len(connection.queries))
... (вывод пачки cвязанных объектов) ...
Queries performed: 2
Size: a a a
AD
DT
AD
DT
AD
DT
AD
DT
•
AD
AD
DT
Н
•
Н
•
AD
•