(domain, app_id=None)
return latest_ids_and_versions
Returns all the latest app_ids and versions in a dictionary.
    :param domain: The domain to get the app from
    :param app_id: The app_id to get the latest version from. If not specified gets latest versions of all
        apps in the domain
    :returns: {app_id: latest_version}
Returns all the latest app_ids and versions in a dictionary.
    :param domain: The domain to get the app from
    :param app_id: The app_id to get the latest version from. If not specified gets latest versions of all
        apps in the domain
    :returns: {app_id: latest_version}
Returns all the latest app_ids and versions in a dictionary . : param domain : The domain to get the app from : param app_id : The app_id to get the latest version from . If not specified gets latest versions of all apps in the domain : returns : { app_id : latest_version }
def get_latest_app_ids_and_versions(domain, app_id=None):
    """
    Returns all the latest app_ids and versions in a dictionary.
    :param domain: The domain to get the app from
    :param app_id: The app_id to get the latest version from. If not specified gets latest versions of all
        apps in the domain
    :returns: {app_id: latest_version}
    """
    from .models import Application
    key = [domain]

    results = Application.get_db().view(
        'app_manager/applications_brief',
        startkey=key + [{}],
        endkey=key,
        descending=True,
        reduce=False,
        include_docs=True,
    ).all()

    latest_ids_and_versions = {}
    if app_id:
        results = [r for r in results if r['value']['_id'] == app_id]
    for result in results:
        app_id = result['value']['_id']
        version = result['value']['version']

        # Since we have sorted, we know the first instance is the latest version
        if app_id not in latest_ids_and_versions:
            latest_ids_and_versions[app_id] = version

    return latest_ids_and_versions
def get_latest_app_ids_and_versions ( domain , app_id = None ) : from . models import Application key = [ domain ] results = Application . get_db ( ) . view ( 'app_manager/applications_brief' , startkey = key + [ { } ] , endkey = key , descending = True , reduce = False , include_docs = True , ) . all ( ) latest_ids_and_versions = { } if app_id : results = [ r for r in results if r [ 'value' ] [ '_id' ] == app_id ] for result in results : app_id = result [ 'value' ] [ '_id' ] version = result [ 'value' ] [ 'version' ] # Since we have sorted, we know the first instance is the latest version if app_id not in latest_ids_and_versions : latest_ids_and_versions [ app_id ] = version return latest_ids_and_versions