Suppose I have something like this in my models.py:
class Hipster(models.Model): name = CharField(max_length=50) class Party(models.Model): organiser =
Easier with exclude:
exclude
# organized by user and has more than 0 participants Party.objects.filter(organizer=user).exclude(participants=None)
Also returns distinct results