realms-wiki/realms/modules/search/hooks.py
2014-11-10 10:54:46 -06:00

15 lines
377 B
Python

from realms.modules.wiki.models import Wiki
from realms.modules.search.models import Search
@Wiki.after('write_page')
def wiki_write_page(name, content, **kwargs):
body = dict(name=name,
content=content)
body.update(kwargs)
return Search.index('wiki', 'page', body=body)
@Wiki.after('rename_page')
def wiki_rename_page(*args, **kwargs):
pass