Exemplo n.º 1
0
    def enqueue(self, action, instance):
        from parliament.search.models import IndexingTask
        it = IndexingTask(action=action, identifier=get_identifier(instance))
        if action == 'update':
            it.content_object = instance

        it.save()
Exemplo n.º 2
0
    def enqueue(self, action, instance):
        it = IndexingTask(
            action=action,
            identifier=get_identifier(instance)
        )
        if action == 'update':
            it.content_object = instance

        it.save()
    def enqueue(self, action, instance):
        from parliament.search.models import IndexingTask
        it = IndexingTask(
            action=action,
            identifier=get_identifier(instance)
        )
        if action == 'update':
            it.content_object = instance

        it.save()
Exemplo n.º 4
0
    def enqueue(self, action, instance):
        try:
            connections['default'].get_unified_index().get_index(
                instance.__class__)
        except NotHandled:
            return False

        it = IndexingTask(action=action, identifier=get_identifier(instance))
        if action == 'update':
            it.content_object = instance

        it.save()
Exemplo n.º 5
0
    def enqueue(self, action, instance):
        try:
            connections['default'].get_unified_index().get_index(instance.__class__)
        except NotHandled:
            return False

        it = IndexingTask(
            action=action,
            identifier=get_identifier(instance)
        )
        if action == 'update':
            it.content_object = instance

        it.save()