예제 #1
0
파일: extract.py 프로젝트: we1l1n/aleph
def location_country(location):
    try:
        key = tag_key(location)
        value = kv.lrange(place_key(key), 0, -1)
        return ensure_list(value)
    except KeyError:
        return []
예제 #2
0
 def __init__(self, label, span, countries):
     super(LocationResult, self).__init__(label, span, countries)
     if self.key is not None:
         try:
             value = kv.lrange(place_key(self.key), 0, -1)
             self.countries = ensure_list(value)
         except KeyError:
             pass