models.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:timestrap 作者: overshard 项目源码 文件源码
def get_total_cost(self):
        total_cost = Decimal()
        for entry in self.entries.iterator():
            try:
                if entry.task.hourly_rate:
                    total_cost += (
                        duration_decimal(entry.duration)
                        * entry.task.hourly_rate
                    )
            except:  # noqa: E722
                continue
        return total_cost.quantize(Decimal('.01'), rounding=ROUND_DOWN)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号