0
chron_id
'un mevcut olup olmadığını ve çiftleri olmadan satırlar olup olmadığını kontrol etmek istiyorum. chron_id
boşsa, tüm satırları alın.Django filtrelerini birleştirin
toponymies_one = Toponymy.objects.filter(chron_id__isnull=False).distinct('chron_id')
toponymies_two = Toponymy.objects.filter(chron_id__isnull=True)
Bu iki sorgu kümesini birleştirmeliyim mi? Bunu yapmanın daha iyi bir yolu var mı?
| id | somevalue | somevalue | chron_id |
|----|-----------|-----------|----------|
| 1 | foo | foo | | # I want this row
| 2 | bar | foo | 2 |
| 3 | foo | bar | | # I want this row
| 4 | foo | foo | | # I want this row
| 5 | bar | foo | 5 |
| 6 | foo | bar | | # I want this row
| 7 | foo | foo | | # I want this row
| 8 | bar | foo | 5 | # I want this row
| 9 | foo | bar | 2 | # I want this row
Teşekkür ...
Q
vide yoluyla filtreye kullanarak VEYA statment hakkında