Good morning all!
I have a model with 3 tables - Customer, Booking and Invoice.
Booking and Invoice are related to the Customer table as follows:
class Booking(models.Model):
customer = models.ForeignKey('Customer', on_delete=models.CASCADE, )
class Invoice(models.Model):
booking = models.OneToOneField(Booking, on_delete=models.CASCADE,)
If I want to search for all of the invoices relating to a specific customer, what is the best way to do that?