示例#1
0
def purge_from_autocomplete_caches(key, cachekey_base, prefixes):
  for cache in [SetQueryCache.fetch(cachekey_base % prefix) for
                prefix in prefixes]:
    try:
      cache.remove(key)
      cache.save()
    except KeyError:
      pass
示例#2
0
def add_to_autocomplete_caches(key, cachekey_base, prefixes):
  for cache in [SetQueryCache.fetch(cachekey_base % prefix) for
                prefix in prefixes]:
    cache.add(key)
    cache.save()