I'm aware that signals aren't triggered for bulk updates, however, I need this behaviour. I'm wondering which of these two ways is more efficient:
qs = MyObject.objects.all()
Do a bulk update, then in a loop manually trigger the signal for each instance:
qs.update(active=True) for instance in qs: post_save.send(sender=MyObject, instance=instance)
Loop the qs and call save on each instance:
for instance in qs: instance.active = True instance.save(update_fields=['active'])