def update_job_in_solr(sender, instance, action, **kwargs): """ Once a job is no longer associated with any locations, it should be removed from SOLR. """ if action in ['post_remove', 'post_clear']: guids = JobLocation.objects.filter(jobs__isnull=True).values_list( 'guid', flat=True) delete_by_guid(guids)
def update_job_in_solr(sender, instance, action, **kwargs): """ Once a job is no longer associated with any locations, it should be removed from SOLR. """ if action in ['post_remove', 'post_clear']: guids = JobLocation.objects.filter( jobs__isnull=True).values_list('guid', flat=True) delete_by_guid(guids)
def remove_from_solr(self): guids = [location.guid for location in self.locations.all()] delete_by_guid(guids)