Django: updating a field with a progressive number within an ordered queryset
Using Django 1.2.3, I need to u开发者_运维知识库pdate a model field with a ranking among an ordered set of instances, without having to retrieve the entire queryset and update each model by hand.
Is there a way to achieve that?
I think this is what you need: http://docs.djangoproject.com/en/dev/topics/db/queries/#updating-multiple-objects-at-once
精彩评论