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' ]
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' ]
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)
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)