Update datasource.py

change the condition from "if queryset" to "if queryset.exists()" would increase performances, since exists method doesn't need to load all the queryset.