コード例 #1
0
ファイル: utils.py プロジェクト: nnestle/commcare-hq
def get_app_build(app_dict):
    domain = Domain.get_by_name(app_dict["domain"])
    if domain.use_cloudcare_releases:
        return ApplicationBase.get(app_dict["_id"]).get_latest_app()["_id"]
    else:
        return ApplicationBase.get_latest_build(app_dict["domain"], app_dict["_id"])["_id"]
    return None
コード例 #2
0
ファイル: utils.py プロジェクト: hashimoto-hb/commcare-hq
def get_app_build(app_dict):
    domain = Domain._get_by_name(app_dict['domain'])
    if domain.use_cloudcare_releases:
        return ApplicationBase.get(app_dict['_id']).get_latest_app()['_id']
    else:
        return ApplicationBase.get_latest_build(app_dict['domain'], app_dict['_id'])['_id']
    return None
コード例 #3
0
def get_app_build(app_dict):
    domain = Domain.get_by_name(app_dict['domain'])
    if domain.use_cloudcare_releases:
        return ApplicationBase.get(app_dict['_id']).get_latest_app()['_id']
    else:
        return get_latest_build_id(app_dict['domain'], app_dict['_id'])
    return None
コード例 #4
0
ファイル: util.py プロジェクト: NoahCarnahan/commcare-hq
def _get_version_from_build_id(domain, build_id):
    try:
        build = ApplicationBase.get(build_id)
    except ResourceNotFound:
        return None
    if not build.copy_of:
        return None
    elif build.domain != domain:
        return None
    else:
        return build.version
コード例 #5
0
ファイル: util.py プロジェクト: kkaczmarczyk/commcare-hq
def _get_version_from_build_id(domain, build_id):
    try:
        build = ApplicationBase.get(build_id)
    except ResourceNotFound:
        return None
    if not build.copy_of:
        return None
    elif build.domain != domain:
        return None
    else:
        return build.version
コード例 #6
0
ファイル: util.py プロジェクト: ansarbek/commcare-hq
def get_version_from_build_id(domain, build_id):
    """
    fast lookup of app version number given build_id

    implemented as simple caching around _get_version_from_build_id

    """
    if not build_id:
        return None

    try:
        build = ApplicationBase.get(build_id)
    except ResourceNotFound:
        return None
    if not build.copy_of:
        return None
    elif build.domain != domain:
        return None
    else:
        return build.version