46👍
✅
An m2m field is returned as a related manager object so its not iterable. You need to use all to convert it to a queryset to make it iterable.
if tbl_scope == 'Generic':
checked_objects = A.objects.get(user=user, project=project)
for checked_object in checked_objects.definitions.all():
print(checked_object.indicator)
You can read more about m2m field.
Source:stackexchange.com