/usr/share/pyshared/djapian/signals.py is in python-django-djapian 2.3.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 | """
Here are the post_save and the pre_delete signals
"""
from djapian.models import Change
def post_save(sender, instance, created, *args, **kwargs):
'''Create the Change object to update the index'''
Change.objects.create(object=instance, action= created and "add" or "edit")
def pre_delete(sender, instance, *args, **kwargs):
'''Create the Change object to update the index'''
Change.objects.create(object=instance, action="delete")
|