def filter_city_import(sender, items, **kwargs): #items[1] is City name if (items[1] == 'Markham'): print("items[1]", items[1]) print("items[8]", items[8]) print("items[10]", items[10]) #items[8] is country code, items[10] is province/state code if items[8] not in (['CA']) or items[10] not in (['08']): raise cities_light.InvalidItems()
def filter_region_import(sender, items, **kwargs): #items[2] is State/Province name print("items[2]", items[2]) if items[2] not in (['Ontario']): raise cities_light.InvalidItems()
def filter_city_import(sender, items, **kwargs): if items[8] not in COUNTRIES: raise cities_light.InvalidItems()
def filter_region_import(sender, items, **kwargs): if items[0].split('.')[0] not in COUNTRIES: raise cities_light.InvalidItems()
def filter_city_import(sender, items, **kwargs): if items[8] not in ('AR', 'BR'): raise cities_light.InvalidItems()
def filter_country_import(sender, items, **args): if items[0].split('.')[0] not in VALID_COUNTRIES: raise cities_light.InvalidItems()
def filter_region_import(sender, items, **kwargs): if items[0].split('.')[0] not in ('ES', 'FR', 'SE', 'PT', 'IT', 'NO', 'DE', 'GB', 'JP', 'KR', 'CA', 'MX', 'US', 'AU', 'VE', 'EC', 'AR', 'UY', 'PY', 'CL', 'BO', 'ZA', 'EG'): raise cities_light.InvalidItems()
def filter_city_import(sender, items, **kwargs): if items[8] not in 'ES' or int(items[14]) < 10000: raise cities_light.InvalidItems()