本文整理汇总了Python中crashstats.supersearch.models.SuperSearch.clear_implementations_cache方法的典型用法代码示例。如果您正苦于以下问题:Python SuperSearch.clear_implementations_cache方法的具体用法?Python SuperSearch.clear_implementations_cache怎么用?Python SuperSearch.clear_implementations_cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类crashstats.supersearch.models.SuperSearch
的用法示例。
在下文中一共展示了SuperSearch.clear_implementations_cache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: supersearch_field_update
# 需要导入模块: from crashstats.supersearch.models import SuperSearch [as 别名]
# 或者: from crashstats.supersearch.models.SuperSearch import clear_implementations_cache [as 别名]
def supersearch_field_update(request):
field_data = _get_supersearch_field_data(request.POST)
if isinstance(field_data, basestring):
return http.HttpResponseBadRequest(field_data)
api = SuperSearchField()
api.update_field(**field_data)
SuperSearch.clear_implementations_cache()
log(request.user, 'supersearch_field.put', field_data)
# Refresh the cache for the fields service.
SuperSearchFields().get(refresh_cache=True)
return redirect(reverse('manage:supersearch_fields'))
示例2: supersearch_field_delete
# 需要导入模块: from crashstats.supersearch.models import SuperSearch [as 别名]
# 或者: from crashstats.supersearch.models.SuperSearch import clear_implementations_cache [as 别名]
def supersearch_field_delete(request):
field_name = request.GET.get('name')
if not field_name:
return http.HttpResponseBadRequest('A "name" is needed')
api = SuperSearchField()
api.delete_field(name=field_name)
SuperSearch.clear_implementations_cache()
log(request.user, 'supersearch_field.delete', {'name': field_name})
# Refresh the cache for the fields service.
SuperSearchFields().get(refresh_cache=True)
url = reverse('manage:supersearch_fields')
return redirect(url)
示例3: supersearch_field_create
# 需要导入模块: from crashstats.supersearch.models import SuperSearch [as 别名]
# 或者: from crashstats.supersearch.models.SuperSearch import clear_implementations_cache [as 别名]
def supersearch_field_create(request):
field_data = _get_supersearch_field_data(request.POST)
if isinstance(field_data, basestring):
return http.HttpResponseBadRequest(field_data)
api = SuperSearchField()
api.create_field(**field_data)
log(request.user, 'supersearch_field.post', field_data)
# Refresh the cache for the fields service.
SuperSearchFields().get(refresh_cache=True)
SuperSearch.clear_implementations_cache()
# The API is using cache to get all fields by a specific namespace
# for the whitelist lookup, clear that cache too.
cache.delete('api_supersearch_fields_%s' % field_data['namespace'])
return redirect(reverse('manage:supersearch_fields'))