if b.project is None: return ''
return b.project.name
+ def audience(self):
+ try:
+ return self.document_books.first().wldocument().book_info.audience or ''
+ except:
+ return ''
+
def get_estimated_costs(self):
return {
work_type: work_type.calculate(self)
if pbr is not None and pbr.timestamp.date() > cutoff:
months = (this_month - pbr.timestamp.date()).days / 365 * 12
+ if not months:
+ return
+
stats = self.bookmonthlystats_set.filter(date__gte=cutoff).aggregate(
views_page=models.Sum('views_page'),
views_reader=models.Sum('views_reader')