models.py 文件源码

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

项目:sample-platform 作者: CCExtractor 项目源码 文件源码
def __init__(self, test_id, status, message, timestamp=None):
        """
        Parametrized constructor for the TestProgress model

        :param test_id: The value of the 'test_id' field of TestProgress model
        :type test_id: int
        :param status: The value of the 'status' field of TestProgress model
        :type status: TestStatus
        :param message: The value of the 'message' field of TestProgress model
        :type message: str
        :param timestamp: The value of the 'timestamp' field of TestProgress
         model (None by default)
        :type timestamp: datetime
        """
        self.test_id = test_id
        self.status = status
        tz = get_localzone()
        if timestamp is None:
            timestamp = tz.localize(datetime.datetime.now(), is_dst=None)
            timestamp = timestamp.astimezone(pytz.UTC)
        if timestamp.tzinfo is None:
            timestamp = pytz.utc.localize(timestamp, is_dst=None)
        self.timestamp = timestamp
        self.message = message
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号