开发者

django, distinct() not behaving

For some reason duplicate values aren't eliminated.

开发者_如何学JAVArecords = Records.objects.all()
records2 = records.values_list('columna','columna').distinct()
print records2

I must be doing something stupid


My solution was to cast the values_list to a set (to remove duplicates) then back to a list

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜