models.py 文件源码

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

项目:annotran 作者: BirkbeckCTP 项目源码 文件源码
def get_report(cls, translation, author, reporter):
        """
        Get a report by page, language, group, author, and reporter
        :param translation: the translation (page, group, language) to which the report corresponds
        :param author: the author to query
        :param reporter: the reporting user to query
        :return:
        """
        if translation and author and reporter:
            try:
                return cls.query.filter(
                    cls.page_id == translation.page_id,
                    cls.language_id == translation.language_id,
                    cls.group_id == translation.group_id,
                    cls.author_id == author.id,
                    cls.reporter_id == reporter.id).one()
            except exc.NoResultFound:
                return None
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号