开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜