result= Booking.objects.filter() #方法一 .exists() if result.exists(): print "QuerySet has Data" else: print "QuerySet is empty" #方法二 .count()==0 if result.count() == 0: print "empty" #方法三 if result: print "QuerySet has Dat…
result= Booking.objects.filter() #方法一 .exists() if result.exists(): print "QuerySet has Data" else: print "QuerySet is empty" #方法二 .count()==0 if result.count() == 0: print "empty" #方法三 if result: print "QuerySet has Dat…