I am trying to write something like this:
somequeryset.order_by("some_field").update(rank="...")
where the "..." is such that all the objects in the queryset have their field "rank" set to a value that is an enumeration of the position of the objects in order determined by the order_by() method. That is, if the order is object_1, object_2, ..., object_n I would like to have their rank field reflect the order, so that object_1.rank = 1, object_2.rank = 2, etc.
Is it possible?