@staticmethod<EOL><INDENT>def _update(qs):<DEDENT>
try:<EOL><INDENT>with transaction.atomic():<EOL><INDENT>qs.update(sort_order=models.F('<STR_LIT>') + <NUM_LIT:1>)<EOL><DEDENT><DEDENT>except IntegrityError:<EOL><INDENT>for obj in qs.order_by('<STR_LIT>'):<EOL><INDENT>qs.filter(pk=obj.pk).update(sort_order=models.F('<STR_LIT>') + <NUM_LIT:1>)<EOL><DEDENT><DEDENT>
Increment the sort_order in a queryset.

Handle IntegrityErrors caused by unique constraints.