Django - replacing string in Model.objects.extra for variable
For example, if I have list of ids values like this:
values = list(set(Handler.objects.filter(blog=1).values_list('entry_id', f开发者_运维技巧lat=True)))
and i want to give variable "values" instead of numbers in string format to extra method like this:
Entry.objects.extra(where=['id IN (3, 4, 5, 20)'])
It is possible somehow to replace numbers for "values"?
... Huh?
Entry.objects.filter(id__in=values)
精彩评论