(location_ids, domain, base_queryset=None)
return locations
Returns the SQLLocations with the given location_ids, ensuring
    that they belong to the given domain. Raises SQLLocation.DoesNotExist
    if any of the locations do not match the given domain or are not
    found.
Returns the SQLLocations with the given location_ids, ensuring
    that they belong to the given domain. Raises SQLLocation.DoesNotExist
    if any of the locations do not match the given domain or are not
    found.
Returns the SQLLocations with the given location_ids ensuring that they belong to the given domain . Raises SQLLocation . DoesNotExist if any of the locations do not match the given domain or are not found .
def get_locations_from_ids(location_ids, domain, base_queryset=None):
    """
    Returns the SQLLocations with the given location_ids, ensuring
    that they belong to the given domain. Raises SQLLocation.DoesNotExist
    if any of the locations do not match the given domain or are not
    found.
    """
    if not base_queryset:
        base_queryset = SQLLocation.objects

    location_ids = list(set(location_ids))
    expected_count = len(location_ids)

    locations = base_queryset.filter(
        domain=domain,
        is_archived=False,
        location_id__in=location_ids,
    )
    if len(locations) != expected_count:
        raise SQLLocation.DoesNotExist('One or more of the locations was not found.')
    return locations
def get_locations_from_ids ( location_ids , domain , base_queryset = None ) : if not base_queryset : base_queryset = SQLLocation . objects location_ids = list ( set ( location_ids ) ) expected_count = len ( location_ids ) locations = base_queryset . filter ( domain = domain , is_archived = False , location_id__in = location_ids , ) if len ( locations ) != expected_count : raise SQLLocation . DoesNotExist ( 'One or more of the locations was not found.' ) return locations