def location_country(location): try: key = tag_key(location) value = kv.lrange(place_key(key), 0, -1) return ensure_list(value) except KeyError: return []
def add(self, prop, value): key = tag_key(value) if key is None: return if (key, prop) not in self.values: if len(self.values) > self.MAX_TAGS: return self.values[(key, prop)].append(value) self.types[prop] += 1
def add(self, type_, tag): key = tag_key(tag) if key is None: return if (key, type_) not in self.tags: self.tags[(key, type_)] = [] self.tags[(key, type_)].append(tag) if type_ not in self.types: self.types[type_] = 0 self.types[type_] += 1