I am working on a reservation system, and I can not find a good way to select free dates. Here is my model:

```
class rental_group(models.Model):
    group_title = models.CharField(max_length = 30)
    description = models.TextField()

class rental_units(models.Model):
    group = models.ForeignKey(rental_group)
    number = models.CharField(max_length = 6)

class Reservations(models.Model):
    #name = models.ForeignKey(customer)
    rental_unit = models.ForeignKey(rental_units)
    start_date = models.DateField()
    end_date = models.DateField()

```

I tried to select available rooms with this query:

```
rental_units.objects.filter(group__rental_group = 'Bungalow').exclude(Q(Reservations__start_date__lt = arrival)&Q(Reservations__end_date__gt = arrival)|Q(Reservations__start_date__lt = departure)&Q(Reservations__end_date__gt = departure))

```

This works perfect when there is only one reservation. When there are more reservations on the same number, things go wrong. For example when I have two reservations on number 120 this query returns 120 twice when everything is available. And 120 is returns once if the the new reservation is between one of the old reservetaion dates (should be zero "not availble")

Is this possible with a query? Or should I iter over the reservations, and remove the reservated house from a list (which could take a lot of time when there are lots of reservations)