Форум сайта python.su
Имеется модель:
class Info(models.Model):
first = models.ForeignKey(First, blank=True, null=True)
second = models.ForeignKey(Second, blank=True, null=True)
desc = models.CharField(max_length=250, blank=True, null=True)
1) Info.objects.filter(first=self, second=None)
2) Info.objects.filter(first=self, second__isnull=True)
Отредактировано (Июль 23, 2010 23:26:11)
Офлайн
Info.objects.filter(first=self).filter(second=None)
Офлайн