def get_paginated_response(self, data): return Response( OrderedDict([('count', self.count), ('next', self.get_next_link()), ('previous', self.get_previous_link()), ('total_duration', duration_decimal(self.total_duration)), ('subtotal_duration', duration_decimal(self.subtotal_duration)), ('results', data)]))
def get_paginated_response(self, data): return Response( OrderedDict([ ("count", self.count), ("next", self.get_next_link()), ("previous", self.get_previous_link()), ("total_duration", duration_decimal(self.total_duration)), ("subtotal_duration", duration_decimal(self.subtotal_duration)), ("results", data), ]))
def get_amount(self, obj): total = Decimal('0.00') for entry in obj.entries.iterator(): total += Decimal( duration_decimal(entry.duration) * entry.task.hourly_rate) return total.quantize(Decimal('.01'), rounding=ROUND_DOWN)