[Answer]-Select object with no foreignKey object

1👍

How to select all building with no Rate?

You can do this using isnull condition as

Building.objects.filter(rate__isnull=True).order_by('customer__last_name')
👤Rohan

0👍

How about:

buildings_without_rate= Building.objects.filter(rate=None).order_by(...)

?

Leave a comment