if pbr is not None and pbr.timestamp.date() > cutoff:
months = (this_month - pbr.timestamp.date()).days / 365 * 12
if pbr is not None and pbr.timestamp.date() > cutoff:
months = (this_month - pbr.timestamp.date()).days / 365 * 12
stats = self.bookmonthlystats_set.filter(date__gte=cutoff).aggregate(
views_page=models.Sum('views_page'),
views_reader=models.Sum('views_reader')
stats = self.bookmonthlystats_set.filter(date__gte=cutoff).aggregate(
views_page=models.Sum('views_page'),
views_reader=models.Sum('views_reader')