cyberco wrote: > Given: > > =========Models========== > class T(models.Model): > pass > > class Y(models.Model): > t = models.ForeignKey(T, blank=True, null=True) > ======================== > > I want to select all instances of a Y that have a null value for t. I > would say that it should be... > > ======================== > Y.objects.filter(t_id=None) > > ======================== > > ...but that returns all instances of T although some instances > definitely have a value for t.
...filter(t__isnull=True) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---