I’m running metrics on user data and want exclude users that have bogus emails like ‘@example.com’ or ‘@test.com’.
I tried
emails_to_exclude = ['@example.com', '@test.com', '@mailinator.com' ....]
Users.objects.exclude(email__endswith__in=emails_to_exclude)
Unfortunately this doesn’t work. Looks like endswith and in don’t play nice with each other. Any ideas?
Simply loop over the QuerySet, as QuerySets are lazy.