You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
474 B
20 lines
474 B
from djapian import space, Indexer
|
|
|
|
from .models import PageProxy
|
|
|
|
|
|
def is_searchable(indexer, obj):
|
|
return obj.published and not obj.publisher_is_draft and obj.level > 0
|
|
|
|
|
|
class PageProxyIndexer(Indexer):
|
|
fields = ['proxy_get_content']
|
|
tags = [
|
|
('teaser', 'proxy_get_teaser'),
|
|
('title', 'proxy_get_title'),
|
|
('path', 'proxy_get_path'),
|
|
]
|
|
trigger = is_searchable
|
|
|
|
|
|
space.add_index(PageProxy, PageProxyIndexer, attach_as='indexer')
|
|
|