models.py 文件源码

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

项目:teamreporter 作者: agilentia 项目源码 文件源码
def can_issue_daily(self):
        """
        ``Report`` can issue ``DailyReport`` if and only if
            - occurs today ( hence ``get_daily`` ),
            - daily hasn't been issued yet for day,
            - members list is not empty,
            - questions list is not empty.

        :return: whether daily report can be generated
        :rtype: bool
        """
        already_issued = self.dailyreport_set.filter(date=date.today()).exists()
        group_not_empty = self.team.users.exists()
        questions_not_empty = self.question_set.filter(active=True).exists()
        return all([self.occurs_today,
                    group_not_empty,
                    questions_not_empty,
                    self.survey_send_time <= now().time(),
                    not already_issued])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号