Hi, I have the following simplified models. Then I create a number of IP addresses and interfaces, with not all IP addresses being related to an interface.
class IPAddress(models.Model): address = models.CharField(maxlength=15) class Admin: pass class Interface(models.Model): name = models.CharField(maxlength=15) ipaddress = models.ForeignKey(IPAddress) class Admin: pass Then when I try: >>> IPAddress.objects.filter(interface__isnull=False) I get a list of IPAddresses that have related interfaces. Then if I try: >>> IPAddress.objects.filter(interface__isnull=True) I get an empty list when I expected to be getting the IP addresses that are not related to any interfaces. Right? Ultimately I'd like to do this: class Interface(models.Model): name = models.CharField(maxlength=15) ipaddress = models.ForeignKey(IPAddress, limit_choices_to={'interface__isnull':True}) class Admin: pass so that the admin will only should "free" ip addresses not ones that ae already used. Is this a bug? Am I doing the wrong lookup? regards matthew --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---