def index_webapps(ids, **kw): # DEPRECATED: call WebappIndexer.index_ids directly. homescreens = set( Webapp.tags.through.objects.filter( webapp_id__in=ids, tag__tag_text='homescreen').values_list('webapp_id', flat=True)) webapps = set(ids) - homescreens if homescreens: HomescreenIndexer.index_ids(list(homescreens), no_delay=True) if webapps: WebappIndexer.index_ids(list(webapps), no_delay=True)
def index_webapps(ids, **kw): # DEPRECATED: call WebappIndexer.index_ids directly. homescreens = set( Webapp.tags.through.objects.filter( webapp_id__in=ids, tag__tag_text='homescreen') .values_list('webapp_id', flat=True)) webapps = set(ids) - homescreens if homescreens: HomescreenIndexer.index_ids(list(homescreens), no_delay=True) if webapps: WebappIndexer.index_ids(list(webapps), no_delay=True)
def index_webapps(ids, **kw): # DEPRECATED: call WebappIndexer.index_ids directly. WebappIndexer.index_ids(ids, no_delay=True)
def update_search_index(sender, instance, **kwargs): WebappIndexer.index_ids([instance.webapp_id])
def tarako_failed(review): """Remove the tarako tag from the app.""" tag = Tag(tag_text='tarako') tag.remove_tag(review.app) WebappIndexer.index_ids([review.app.pk])
def tarako_passed(review): """Add the tarako tag to the app.""" tag = Tag(tag_text='tarako') tag.save_tag(review.app) WebappIndexer.index_ids([review.app.pk])
def update_search_index(sender, instance, **kwargs): WebappIndexer.index_ids([instance.addon_id])