📜  从查询集 django 中获取 id 列表 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:20.517000             🧑  作者: Mango

代码示例1
author = Blog.objects.filter(author=author)
ids    = author.values_list('pk', flat=True)

# list method get ids without parse the returning queryset

print(list(ids))