django queryset to dict?

stackoverflow answers: model.objects.values()
actually queryset.values() is still query set, in essence, more close to list
check if a queryset is empty is django,
if not queryset.values():
print("query set empty")
the same as to check if a list is empty

你可能感兴趣的:(django queryset to dict?)