Is there a way to do the following in a single line with a django query?
providers_with_no_contacts = []
for provider in Provider.objects.all():
if not provider.userprofile_set.all():
provider_with_no_contacts.append(provider)
Or a better way than this?
providers_with_no_contacts = [provider for provider in Provider.objects.all()
if not provider.userprofile_set.all()]