'Get the number of matching objects.'

def __len__(self):

    if (not self._rows):
        return len(self._objects)
    elif self.query:
        count = 0
        for obj in self:
            count += 1
        return count
    else:
        return self._row_count
