django queryset to dict?

2017-10-05  本文已影响0人  AtrributeError

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

上一篇下一篇

猜你喜欢

热点阅读