job.py 文件源码

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

项目:django-celery-growthmonitor 作者: mbourqui 项目源码 文件源码
def job_data(instance, filename=''):
    """
    Return the path of `filename` stored in a subfolder of the root folder of his job `instance`.

    Parameters
    ----------
    instance : AJob or ADataFile
        The model instance associated
    filename : str
        Original filename

    Returns
    --------
    str
        Path to filename which is unique for a job
    """
    head = root_job(instance.job) if isinstance(instance, ADataFile) else root_job(instance)
    tail = _user_path(instance.upload_to_data, filename) or os.path.join('data', filename)
    return os.path.join(head, tail)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号