empty queryset django code example
Example 1: django empty queryset
Model.objects.none()
Example 2: maek empty querytset
MyModel.objects.none()
Example 3: checking if a queryset is empty django
orgs = Organisation.objects.filter(name__iexact = 'Fjuk inc')
if not orgs:# If any results
# Do this with the results without querying again.
else:# Else, do something else...
# Do that...