Esempio n. 1
0
def get_test_district_locations_id(domain):
    return [
        sql_location.location_id
        for sql_location in SQLLocation.by_domain(domain).filter(
            location_type__code=const.LocationTypes.DISTRICT)
        if sql_location.metadata.get('is_test_location', 'real') == 'test'
    ]
Esempio n. 2
0
def get_test_district_locations_id(domain):
    return [
        sql_location.location_id
        for sql_location in SQLLocation.by_domain(domain).filter(location_type__code=const.LocationTypes.DISTRICT)
        if sql_location.metadata.get('is_test_location', 'real') == 'test'
    ]
Esempio n. 3
0
def _user_locations_ids(project, show_administrative):
    locations = SQLLocation.by_domain(project.name)
    if show_administrative == 'False':
        locations = locations.filter(location_type__administrative=True)
    # admins and users not assigned to a location can see and edit everything
    return locations.values_list('location_id', flat=True)
Esempio n. 4
0
def _user_locations_ids(project, show_administrative):
    locations = SQLLocation.by_domain(project.name)
    if show_administrative == 'False':
        locations = locations.filter(location_type__administrative=True)
    # admins and users not assigned to a location can see and edit everything
    return locations.values_list('location_id', flat=True)