async def _reorder_on_update(
    sender: Type[Model],
    instance: Model,
    from_class: Type[Model],
    to_class: Type[Model],
    passed_args: Dict,
):
    """
    Helper function.
    Actually reorders links by given order passed in add/update query to the link
    model.

    Assumes names f"{model.get_name()}_order" like for Animal: animal_order.
    """
    order = f"{from_class.get_name()}_order"
    if order in passed_args:
        query = _get_filtered_query(sender, instance, to_class)
        to_reorder = await query.exclude(pk=instance.pk).order_by(order).all()
        new_order = passed_args.get(order)
        if to_reorder and new_order is not None:
            # can be more efficient - here we renumber all even if not needed.
            for ind, link in enumerate(to_reorder):
                if ind < new_order:
                    setattr(link, order, ind)
                else:
                    setattr(link, order, ind + 1)
            await sender.objects.bulk_update(
                cast(List[Model], to_reorder), columns=[order]
            )

    Helper function.
    Actually reorders links by given order passed in add/update query to the link
    model.

    Assumes names f"{model.get_name()}_order" like for Animal: animal_order.
    
tests/test_ordering/test_default_through_relation_order.py