开发者

How can i add key/value to object queryset

I need to add key/val开发者_如何转开发ue to queryset per each object based on stuff in request.session.

How to do that?

Alan


Historical answer:

You can use the .extra() method on a queryset to add extra 'fields'.

There is some documentation that may be useful.

New answer:

You should use the .annotate() method to add extra fields.

View the documentation.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜