[places] adding world_region tag and adding the phrase West Indies with small random probability for English-speaking Caribbean nations. Ref: #113

This commit is contained in:
Al
2016-09-11 21:54:47 -04:00
parent 069e4c348c
commit 55e9ab1978
3 changed files with 71 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ class PlaceConfig(object):
AddressFormatter.STATE,
AddressFormatter.COUNTRY_REGION,
AddressFormatter.COUNTRY,
AddressFormatter.WORLD_REGION,
}
numeric_ops = (('lte', operator.le),
@@ -139,6 +140,13 @@ class PlaceConfig(object):
value = components[component]
for c in names[value]:
new_components.pop(c, None)
for component in self.ADMIN_COMPONENTS:
value = self.get_property(('components', component, 'value'), country=country, default=None)
if value is not None and component not in components and self.include_component(component, containing_ids, country=country, population=population):
new_components[component] = value
return new_components