Hello, I have a model which looks kinda like this:
class Host(model): ip = IPAddressField() class Domain(model): hosts = ManyToManyField(Host) If i want to get all the domains without hosts: Domain.objects.filter(hosts=None) works. Later on in my script i need to get the opposite, all the domains having one or more hosts associated. using exclude instead of filter with the same condition doesn't work as expected (at least as I expected :-P), it just returns an empty queryset. Is there a way to formulate the query using the django api? or should i use custom sql? thanks Riccardo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---