开发者

Django: raw SQL and values_list() bug?

Doing something lik开发者_StackOverflow中文版e

SomeModel.objects.extra(..).values_list('id', flat=True)

always returns an empty list

Is this a Django bug ? Or am I missing seomthing?


From the documentation:

If you use a values() clause after an extra() clause, any fields defined by a select argument in the extra() must be explicitly included in the values() clause. However, if the extra() clause is used after the values(), the fields added by the select will be included automatically.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜