Ejemplo n.º 1
0
def after_update(sender, **kwargs):
    if 'created' not in kwargs or not kwargs['created']:
        update_index.delay()
    else:
        instance = kwargs['instance']
        Essential.objects.create(job=instance, essential=' ')
        Desireable.objects.create(job=instance, desireable=' ')
Ejemplo n.º 2
0
 def handle_delete(self, sender, instance, **kwargs):
     try:
         type_id = self.get_type_id(instance)
         update_index.delay(instance_id=instance.id,
                            type_id=type_id,
                            ops='remove')
     except SearchException, e:
         logger.error('Not updating search index: %s' % e.message)
Ejemplo n.º 3
0
 def handle_delete(self, sender, instance, **kwargs):
     try:
         type_id = self.get_type_id(instance)
         update_index.delay(instance_id=instance.id,
                            type_id=type_id,
                            ops='remove')
     except SearchException, e:
         logger.error('Not updating search index: %s' % e.message)
Ejemplo n.º 4
0
    def handle_save(self, sender, instance, **kwargs):
        if hasattr(instance, 'is_deleted') and instance.is_deleted:
            # not updating deleted instance
            return

        try:
            type_id = self.get_type_id(instance)
            update_index.delay(instance_id=instance.id,
                               type_id=type_id,
                               ops='update')
        except SearchException, e:
            logger.error('Not updating search index: %s' % e.message)
Ejemplo n.º 5
0
    def handle_save(self, sender, instance, **kwargs):
        if hasattr(instance, 'is_deleted') and instance.is_deleted:
            # not updating deleted instance
            return

        try:
            type_id = self.get_type_id(instance)
            update_index.delay(instance_id=instance.id,
                               type_id=type_id,
                               ops='update')
        except SearchException, e:
            logger.error('Not updating search index: %s' % e.message)