📜  django queryset to list - Python 代码示例

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

代码示例4
from .models import Article

articles = Article.objects.all()

# This will return a queryset type
print(type(articles))

# Convert articles queryset to a python's list type
articles_list = list(articles)

# This will return a list type
print(type(articles_list))